Skip to content
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

NullReferenceException when rendering a file #345

Closed
mc0re opened this issue Nov 6, 2017 · 9 comments
Closed

NullReferenceException when rendering a file #345

mc0re opened this issue Nov 6, 2017 · 9 comments

Comments

@mc0re
Copy link

mc0re commented Nov 6, 2017

This file raises a null-pointer exception in the GaussianBlur filter.

Code (WinForms, VB.NET):

Const SvgPath = "C:\...\Resources\test1.svg"
Dim mSvg = SvgDocument.Open(SvgPath)
mSvg.Width = PictureBox1.Width
mSvg.Height = PictureBox1.Height
Dim bmp = mSvg.Draw()
PictureBox1.Image = bmp

test1.zip

@beastlike
Copy link

throws the same error on .Draw() for this fairly simple SVG file as well, generated by SVG-edit...
simple.zip

If anyone can recommend a production-ready SVG library for .NET please do!

@mc0re
Copy link
Author

mc0re commented Dec 19, 2017

SharpVectors?

@beastlike
Copy link

beastlike commented Dec 20, 2017

It appears that these "'s were causing the problem in my case:
marker-start="url("#se_marker_start_svg_4")" marker-end="url("#se_marker_end_svg_4")"

I looked in your svg xml @mc0re but I wasn't able to fix anything in there that would make it render.

however, now I get this:
image

@mc0re
Copy link
Author

mc0re commented Dec 20, 2017

It's not the XML that should be fixed but the code :-)

@beastlike
Copy link

Also, SharpVectors appears not to be able to handle large resolution files, and ImageMagick doesn't produce transparent background... Is this real life?

@mrbean-bremen
Copy link
Member

I cannot reproduce the crash with both the example files (they are added to the test files).
The other issue with the marker arrows is already mentioned in another issue - closing this one.

@mrbean-bremen
Copy link
Member

Ah, sorry, the first example still crashes - reopen.

@mrbean-bremen
Copy link
Member

The first example now renders correctly except for the arrow direction handled in #215.

@mrbean-bremen
Copy link
Member

Arrow direction is now fixed (and it was a separate problem unrelated to #215).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants