1
Vote

SharpVectors throws DomException when loading the specific svg file

description

SharpVectors throws DomException when loading the specific svg file

file attachments

comments

popo_lan1986 wrote Apr 24 at 3:58 AM

When I tried to convert this svg file, I got a DomException from SharpVectors.

Inner exception 1
Error message:
Input string was not in a correct format.
Exception:
FormatException
Stack trace:
at System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
at SharpVectors.Dom.Svg.SvgNumber.ParseNumber(String str)

I read the code and found the problem is in WpfSvgPaint.GetDashArray method. We get the value of stroke_dasharray property and parse this value in SvgNumber. In the attached svg file, we can see the value of stroke_dasharray property is "null" and only the three cases null, empty string, "none" are handled. It seems that "null" should be treated like "none".