-
Notifications
You must be signed in to change notification settings - Fork 480
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
Problem trying to render SVG objects (Open() method) #916
Comments
Same here. With previous version 3.2.3 this error occurred only on |
I don't have this issue in my SVG file. |
Here is an example (I cannot upload .svg directly, so just delete the .txt suffix.): I'm using SVG library in a .NET Framework 4.8 project also in VS 2019. |
Thanks. SVG file opened correctly in SVGViewer. It seems to be an execution environment issue, not SVG file issue... |
Yes, it works in the most recent SVGViewer on GitHub. Please excuse my dump question, but isnt't this SVGViewer using a newer version as the 3.3.0 from NuGet? For instance the fix #830 is not included in NuGet 3.3.0, but in the current SVGViewer, correct? So we just have to wait for the next release on NuGet, right? |
Yes, that is true. I don't understand though why the current version works for you - #830 is not a new issue, it has been in for several years. Maybe some combination with another change? |
I created the following simple console app and get SVG.NET library from NuGet. using System.IO;
using Svg;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
var rootPath = @"<PATH_TO_ROOT_DIRECTORY>";
var svgPath = Path.Combine(rootPath, "Image.svg");
var imagePath = Path.Combine(rootPath, "Image.png");
using (var image = SvgDocument.Open(svgPath).Draw())
{
image.Save(imagePath);
}
}
}
} Result was output correctly. (3.3.0 - 3.2.1). |
Thank you very much! I'm not very experienced in using Visual Studio. It's quite possible that the error is caused by an environment issue. I have run the SVGViewer from GitHub in a separate .net 5.0 solution, where everything worked well. The error occurred in a .NET Framework 4.8 project where the SVG.net DLL from NuGet is referenced. I'm not familiar enough with Visual Studio to assess, if this could be a reason or how to test it. I will try to find out more...
Edit: |
@RolandJosuran |
@benberlin7 |
My wish for santa this year, that the Svg-Bug is gone by itself next year ;-) |
Description
In a C# project I'm trying to convert from SVG to Image object using the following code:
img = Svg.SvgDocument.Open(filePath).Draw();
The problem is with the 'Open' method since I divided that line into Open first and Draw after it.
And it does not fail but the svg is not being rendered correctly. I also have these traceback errors:
HCTgui.exe Warning: 0 : Attribute 'width' cannot be set - type 'Svg.SvgDocument' cannot convert from string '29.724014mm'.
HCTgui.exe Warning: 0 : Attribute 'height' cannot be set - type 'Svg.SvgDocument' cannot convert from string '16.038712mm'.
HCTgui.exe Warning: 0 : Attribute 'transform' cannot be set - type 'Svg.SvgGroup' cannot convert from string 'translate(-60.535697,-122.57997)'.
HCTgui.exe Warning: 0 : Attribute 'transform' cannot be set - type 'Svg.SvgGroup' cannot convert from string 'matrix(4.5495881,0,0,3.9014996,-235.85594,-137.43323)'.
HCTgui.exe Warning: 0 : Attribute 'transform' cannot be set - type 'Svg.SvgGroup' cannot convert from string 'matrix(0.22003619,0,0,-0.25571455,52.118913,92.951338)'.
HCTgui.exe Warning: 0 : Attribute 'transform' cannot be set - type 'Svg.SvgPath' cannot convert from string 'matrix(0,-1,-1,0,0,0)'.
HCTgui.exe Warning: 0 : Attribute 'd' cannot be set - type 'Svg.SvgPath' cannot convert from string 'm -86.822733,-59.964423 a 6.3617005,14.09141 0 0 1 -5.577324,-6.972381 6.3617005,14.09141 0 0 1 -0.01308,-14.185706 6.3617005,14.09141 0 0 1 5.564423,-7.022775'.
HCTgui.exe Warning: 0 : Attribute 'transform' cannot be set - type 'Svg.SvgPath' cannot convert from string 'rotate(90)'.
HCTgui.exe Warning: 0 : Attribute 'd' cannot be set - type 'Svg.SvgPath' cannot convert from string 'm 102.85328,-59.964423 a 6.3617005,14.09141 0 0 1 -5.57732,-6.972381 6.3617005,14.09141 0 0 1 -0.01308,-14.185706 6.3617005,14.09141 0 0 1 5.564427,-7.022775'.
HCTgui.exe Warning: 0 : Attribute 'stroke-width' cannot be set - type 'Svg.SvgGroup' cannot convert from string '2.470398'.
HCTgui.exe Warning: 0 : Attribute 'stroke-dasharray' cannot be set - type 'Svg.SvgGroup' cannot convert from string 'none'.
HCTgui.exe Warning: 0 : Attribute 'stroke-width' cannot be set - type 'Svg.SvgPath' cannot convert from string '1.509307'.
HCTgui.exe Warning: 0 : Attribute 'stroke-dasharray' cannot be set - type 'Svg.SvgPath' cannot convert from string 'none'.
HCTgui.exe Warning: 0 : Attribute 'stroke-dashoffset' cannot be set - type 'Svg.SvgPath' cannot convert from string '3.779527'.
HCTgui.exe Warning: 0 : Attribute 'stroke-width' cannot be set - type 'Svg.SvgPath' cannot convert from string '1.509307'.
HCTgui.exe Warning: 0 : Attribute 'stroke-dasharray' cannot be set - type 'Svg.SvgPath' cannot convert from string 'none'.
HCTgui.exe Warning: 0 : Attribute 'stroke-dashoffset' cannot be set - type 'Svg.SvgPath' cannot convert from string '3.779527'.
Example data
It happens with any single .SVG I try to use. All of them correctly validated and working.
Used Versions
I'm using Visual Studio 2019 Pro, Windows 10 and SVG 3.3.0
Thank you so much!
The text was updated successfully, but these errors were encountered: