-
Notifications
You must be signed in to change notification settings - Fork 472
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
Lost information after reading Svg #1170
Comments
@mrbean-bremen still looking for help... :( |
I've never had this issue before, so I don't think I'll be able to find the cause right away...
|
Hey @H1Gdev
I tried SVG.NET 3.4.0 and 3.4.7. Both had the same issue.
I think all elements which have these attributes (width, height, transforms,...) are faulty. Some are correctly represented like polygon and path, but they don't use these attributes at all. Heres an analysis from ChatGPT about the differences in 2 SVGs (1 correct from VisualStudio, 1 faulty from the installation):
Additional or Divergent Elements in File 2:
Summary:
|
Today I tried passing a XMLReader with different settings
I also tried
Unfortunately it did not help. But maybe it rules out sth. for you so I wanted to share this info @H1Gdev |
solved it : it was the missing System.Numerics.Vectors.Dll in the installation folder. |
but there is still some mystery behind. It works with the System.Numerics.Vectors.Dll now. But if I paste all DLLs in an older installation (I created several with different options, some can seen above) it still doesn't work. I don't have the ambition to investigate it any longer, because it works now and I already spent way too much time for this issue, but if this happens again to someone else :
Then make sure that System.Vectors.Dll is in your installation folder. |
Description
When I read a SVG with your library in Debug or Release mode from within Visual Studio everything works fine.
However after building an installation and trying it without Visual Studio some SVG data gets lost.
The input SVG is exactly the same. The elements read from that via
SvgDocument.Open(svgFilePath);
or
SvgDocument.FromSvg<SvgDocument>(File.ReadAllText(svgPath));
don't represent all the information of the SVG.
Below you can see some examples (example data). It's just the beginning of the document to show you the problem.
[A] is the SvgContent read via SvgNet in Visual Studio (Debug or Release), plotted via svgDoc.GetXML(). [B] is the exact same Svg Input read from the installation. As you can see the transforms, width, height, stroke-width and x,y values are missing.
I already checked the following:
If I read the elements in the installation via XmlDocument and log the InnerXML to a textfile the transforms etc. are displayed correctly.
I have no clue what I am missing or doing wrong.
Example data
[A] SVG Content read in Visual Studio (DEBUG or RELEASE)
[B] the same SVG Content read from the installation
Used Versions
NET Framework 4.8
SVG.net Version 3.4.7
Win 11
Visual Studio 2022 Professional.
The text was updated successfully, but these errors were encountered: