GNOME Bugzilla – Bug 778187
SVG: property x2 on gradients handled incorrectly with gradientUnits="userSpaceOnUse"
Last modified: 2017-03-02 22:32:35 UTC
Created attachment 344960 [details] Test file containing a gradient with both x2="100%" and gradientUnits="userSpaceOnUse" Note: I hope this is the correct place to report this. eog, GIMP and the preview/thumbnail in Nautilus all display the behavior described here, but I couldn’t find definite information on whether they both use librsvg. The SVG standard <https://www.w3.org/TR/SVG11/pservers.html#LinearGradientElementX1Attribute> specifies that the default value of the “x2” attribute on gradient elements is “100%” and that omitting the attribute is equivalent to specifying x2="100%". However, if gradientUnits="userSpaceOnUse" is also set, the SVG image displays differently depending on whether the x2 attribute is omitted or explicitly set to 100%. Steps to Reproduce: 1) Display both attached sample SVG files (x2_set.svg and x2_unset.svg) using e.g. eog or GIMP and observe the output. Actual Results: The displayed images are different (x2_set.svg shows a gradient which is red to green from left to right, while x2_unset.svg looks like a solid green rectangle). Expected Results: Both images should look the same. Build Date & Hardware: Version 2.40.13-3 of the librsvg2-2 package from the Ubuntu repositories (<https://launchpad.net/ubuntu/xenial/+source/librsvg>) on Ubuntu 16.04.1.
Created attachment 344961 [details] Test file containing a gradient with gradientUnits="userSpaceOnUse" and without x2 set
For what it’s worth, also note that both Firefox and Chromium display both files identically, namely in the same way as eog and GIMP and display the file “x2_set.svg”.
This is fixed in version 2.41.0; I just checked it with the files you provided.