GNOME Bugzilla – Bug 759231
SVG to PNG conversion strange shapes
Last modified: 2017-08-30 15:17:21 UTC
Created attachment 317010 [details] PNG error If you try to convert this svg to png https://www.dropbox.com/s/9vpfwm0zmpaknzc/60749.svg?dl=0 a strange black shape appears on the final image (see attachment). dlemstra quote from image magick forum: "We just upgraded librsvg to the latest version (2.4.12) in the Windows distribution and we still have this issue. It seems that librsvg does not handle '
' properly. When I remove this from your file I get the correct result."
This svg contains few <polygon /> elements whose 'points' attributes are incorrectly parsed because they include \r \n white spaces that rsvg_css_parse_list does not consider as valid delimiters https://git.gnome.org/browse/librsvg/tree/rsvg-css.c#n705 and so when they're parsed as numbers https://git.gnome.org/browse/librsvg/tree/rsvg-css.c#n758 wrong zeroes appear in the point list https://git.gnome.org/browse/librsvg/tree/rsvg-shapes.c#n152 either rsvg_css_parse_list is wrong and should consider \r \t as valid delimitors or a similar function that accepts also \r\t should be used because they're part of the grammar https://www.w3.org/TR/SVG/shapes.html#PointsBNF
This is fixed in the master branch, for the 2.41.x series. I won't be backporting the fix to the 2.40 series, as the parser is rewritten now.