GNOME Bugzilla – Bug 786600
SVG file rendered completely black, no colors shown (due to a <path> attribute refering to a non-existing object)
Last modified: 2017-08-22 16:55:36 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
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.
Thanks for the quick reply and instructions to backport! Appreciated.