After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778187 - SVG: property x2 on gradients handled incorrectly with gradientUnits="userSpaceOnUse"
SVG: property x2 on gradients handled incorrectly with gradientUnits="userSpa...
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.40.x
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2017-02-05 00:24 UTC by simon.may+gnomebz
Modified: 2017-03-02 22:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test file containing a gradient with both x2="100%" and gradientUnits="userSpaceOnUse" (406 bytes, image/svg+xml)
2017-02-05 00:24 UTC, simon.may+gnomebz
Details
Test file containing a gradient with gradientUnits="userSpaceOnUse" and without x2 set (396 bytes, image/svg+xml)
2017-02-05 00:25 UTC, simon.may+gnomebz
Details

Description simon.may+gnomebz 2017-02-05 00:24:57 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.
Comment 1 simon.may+gnomebz 2017-02-05 00:25:33 UTC
Created attachment 344961 [details]
Test file containing a gradient with gradientUnits="userSpaceOnUse" and without x2 set
Comment 2 simon.may+gnomebz 2017-02-05 00:29:57 UTC
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”.
Comment 3 Federico Mena Quintero 2017-03-02 22:32:35 UTC
This is fixed in version 2.41.0; I just checked it with the files you provided.