-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for .NET Core #400
Comments
I adapted the issue title to clarify what this is about. Note that there is a new PR (#415) that specifically adds support for .NET Core 2.2, so that may work for you. |
I'll check it out later, thank you. |
please some workaround or merge pull request to support .net core |
The committer wanted to make some changes I'm waiting for, and we are also waiting for @tebjan for clarification regarding VS version - so I can't give you a definitive date for when this will be merged... |
i'd say VS2017 is fine. if it all works with VS2015, even better. but i think .net core and standard have much better support in 2017. |
Ok, thanks! So merging the PR which requires VS2017 would be fine (once it is finished)? |
@tebjan - I think it would make sense to make another minor release before that, just in case - there have been a few fixes since the last release. |
when can i except that release with .net core support? |
@mrbean-bremen sure thing, i'll upload a new nuget. EDIT: new nuget is up! |
@Noah1911 - it has been some time; if you are still interested, could you please check with current master? |
@mrbean-bremen - yes I'm still interested. I still don't have time to test it, but it looks promising. I try to test it at the end of this week. |
Hey I'm going to chime in here since I had the same problems with .NET core 2.1. This morning I updated everything to .NET core 2.2 and cloned master. I popped the dll in there with a local reference and suddenly all my SVGs started rendering. I'm using an SVG template that I dynamically inject some values into before I go through a few conversions. The conversion chain was SVG template > XmlDoc > SVGDocument > Bitmap > ByteArray(PNG) > Base64 String. I'm returing that Base64 string as a data URI for an image's source tag, and that image lives in an HTML div. Everything renders nicely now. Before I was using SVG 2.4.3 and all of my images were just rendering as either a white box (PNG) or a black box (GIF/JPEG). Thanks for the update. |
Am I interpreting that thread correctly, it looks like the next nuget package release will support .NET Core? Since master source does currently? |
Yes, you are right. Any tests are welcome, especially on non-Windows systems. |
@jackmott it’d be particularly helpful for someone to test on Linux, since I believe nobody has. |
i should be able to help with that monday night when i get home |
@tebjan it seems this is geared to you: to make testing easier i'd advocate for releasing "preview" flavors of nuget packages so you can control the installation process and ensure there's no issues with the variability in people compiling and dropping dlls and such as it seems is needed at the moment to test. |
Yes, I agree. If there are no more fixes on master to release we can bump the major version and do a pre release. |
@tebjan - the ongoing fixes on master are not related to .NET Core support, so I would suggest to make a pre-release for testing specifically .NET Core support. If new fixes accumulate meanwhile, you may make another pre-release later. |
@mrbean-bremen sounds good! i'll do a local build and test it out. |
Hi! Did you solve the problem |
I'm not aware of this problem. Can you file an issue describing the problem? |
I am trying to convert SVG to PNG with this code:
When i start the method it shows: |
I understand you are using .NETCore? |
yes |
Are you using master, or the nuget package? And which OS? |
nuget, windows 10 |
Hm, this exception happens if the root element is not an svg, actually this shall not be dependent on .NETCore. Can you show an example SVG that causes this issue? |
Ok, this looks fine at first glance. I may have another look later today. |
Hm, I couldn't reproduce this. Also, I don't understand where this "Stack empty" message comes from - this is not logged. |
@mrbean-bremen Did you also do a test what happens if you do a render within another render (like @8m0 did in his example), maybe the XML parser/reader somehow messes up if you try to render twice or try to render when there is another bitmap also in use (which might hint on issues with concurrency). The Stack empty can be due to the type of exception used, we use |
@gvheertum - I wrote a small test with the code given above and used it on the example file, though maybe I did something different. I will have a another go at this sometime later (though of course I'd be happy if someone else could tackle this ;) |
I'm on it, I'll make a unittest to test this behavior and keep track of issues when rendering multiple times after each other. By the way, what are your thoughts about the InvalidOperationException being thrown instead of a customized exception? I'm not even sure if the InvalidOperation is the correct type of exception, since it's more likely a parser or document error. |
@mrbean-bremen I put it in a test-harness (see PR #549), I could not test it fully on Mac (somehow Mac goes crazy on fonts), but maybe you can give it a run on Windows. Using a simple SVG without text showed no issues in the unittests when I did them, so if you also have the same result with the Windows run I think this issue can be closed. Edit: after the font fix on Mac I was able to run with the file provided by @8m0 and no problems did occur. |
Thanks for that! I did the test under Windows (with .NET Core) and it all passed. Though I shouldn't have bothered as the AppVeyor build already had passed :) About the I would also tend to close this issue, as support for .NET Core is there, and all problems shall be handled in separate issues. |
Hello, I want to thank you for this awesome lib. However when I deal with .svgs from Adobe Illustrator (not sure which version, because graphics man...) I got bunch of errors like:
The CreateDocument method can only be used to parse root <svg> elements.
orStack empty.
I use SVG 2.4.0, NetCore 2.1.
SVG sample here: https://pastebin.com/jsfeRi1y
Code I use is just simple open and after this the errors happen:
SvgDocument svgDocument = SvgDocument.Open(file);
Edit: maybe it can be fixed by merging #326.
The text was updated successfully, but these errors were encountered: