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 786600 - SVG file rendered completely black, no colors shown (due to a <path> attribute refering to a non-existing object)
SVG file rendered completely black, no colors shown (due to a <path> attribut...
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-08-22 10:01 UTC by André Klapper
Modified: 2017-08-22 16:55 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description André Klapper 2017-08-22 10:01:35 UTC
librsvg2-2.40.18-1.fc26.x86_64

Steps:
1. Download https://commons.wikimedia.org/wiki/File:Google_Photos_icon.svg by
   clicking "Original file"
2. Open the file in "rsvg-view-3"

Expected outcome:
An icon with colors

Actual outcome:
A complete black icon

More info:

Was wondering if bug 786372 is related but I see no <style>.
Forwarding from https://commons.wikimedia.org/wiki/Commons:Village_pump#Curious_svg_glitch
Comment 1 Federico Mena Quintero 2017-08-22 16:32:28 UTC
Short answer: this is fixed in the master branch.

Long answer: Where did you get this file?  The culprit is the last <path> in the file; it has an attribute

  fill="url(#SVGID_5_)"

but no object has an id by that name.  Librsvg 2.40.x erroneously renders that problematic <path> as a black, and it covers the rest of the colorful objects.

(The rest of the file also has a bunch of references to nonexistent objects, so it makes me wonder if the SVG was exported/edited incorrectly.)

If this is super-problematic for you and for some reason you can't remove that <path> from the SVG file, you can try backporting commits 16ae767a8c43bb35d180923c5a3caad73859e04d and 5804c73d0e7ef249a3c5e7c32947b565d7eba036, for the parts that propagate a failure value from _set_source_rsvg_paint_server().  The patches don't apply as they are to 2.40.x, since the master branch assumes that the Rust code for resolving pattern fallbacks is in place.

Marking this bug as fixed; hopefully we'll have the master branch as a usable release soon.
Comment 2 André Klapper 2017-08-22 16:55:36 UTC
Thanks for the quick reply and instructions to backport! Appreciated.