Page MenuHomePhabricator

Only first gradient in the SVG file seems to be processed
Closed, ResolvedPublic

Description

Author: anonmoos

Description:
With the recent software updates, there seem to have been changes in how SVG files are processed. With SVG files generated by CorelDRAW (which use a particular indirect way of referring to style information), it seems that only the _first_ gradient in the SVG file is processed -- while all subsequent gradients are completely ignored. Unfortunately, this really messes up the rendering of such files (compare how http://commons.wikimedia.org/wiki/File:Differencing_en.svg looks in an SVG-viewing program to how it is rendered to a PNG by rsvg), and it will really be a pain to fix such files manually. Therefore it would be nice if the SVG (or XML?) parsing bug could be fixed... ~~~~


Version: unspecified
Severity: normal

Details

Reference
bz27832

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:31 PM
bzimport set Reference to bz27832.
bzimport added a subscriber: Unknown Object (MLST).

Ehm, did this file EVER render on Mediawiki using rsvg ? I highly doubt it. In that case, it's not new behavior, and thus not due to the recent changes.

Seems to me that the librsvg doesn't support xlink, but i'm not sure.

anonmoos wrote:

I don't really know, but there were a number of SVG files that became broken when Mediawiki 1.17 brought in stricter namespace enforcement, and when the namespace problems were fixed with these files, it then appeared that a number of CorelDRAW files which have been being used in various Wikipedia articles for months or years now had quite strange renderings, due to only one gradient per file working.

The SVG support on Wikimedia Commons etc. definitely _does_ support xlink (since a number of somewhat basic SVG functionalities would be impossible without xlink), but in CorelDRAW files, all non-gradient stylings are applied to the relevant elements, but only _ONE_ gradient styling works per file. This can perhaps be seen slightly more clearly in http://commons.wikimedia.org/wiki/File:Salamander.svg , where only the first gold-brown gradient in the file is rendered (in the large flame on top of the salamander's upper back), while all the other gold-brown gradients in the large flames in the file are completely ignored (leaving hollow outlines). This sure seems like a bug to me... ~~~~

Created attachment 8240
firefox vs librsvg

I don't know what firefox uses to display svg's but Emacs uses librsvg and you can see that they both show some funky gradiants in this screenshot.

Attached:

Workspace_1_021.png (1×1 px, 320 KB)

anonmoos wrote:

Re: Attachment 8240 -- The currently most-recently uploaded version of File:Differencing_en.svg on Commons displays fine in both FireFox and Adobe SVG plugin, but as a bunch of black rectangles in the version of Inkscape I have (which is kind of old, however). Applying only the first gradient in a file clearly seems to be buggy behavior...

anonmoos wrote:

Display of Commons file Differencing_en.svg in FireFox on my system

Attached:

Differencing_en_in_FireFox.jpg (545×838 px, 89 KB)

Created attachment 9609
render of image after the recent librsvg upgrade

Attached:

800px-Differencing_en.svg.png (488×800 px, 95 KB)

anonmoos wrote:

Re: latest attachment -- some other bugs seem to have been fixed, but this basic bug has not been.

See http://commons.wikimedia.org/wiki/File:Differencing-en.png for how it should display...

Aklapper renamed this task from rsvg -- apparent error in parsing SVG files (gradients) to Only first gradient in the SVG file seems to be processed.Mar 8 2016, 11:01 PM
Aklapper set Security to None.

I do not see any issues with the file, it appears that the bug has been fixed. If I'm missing something, please attach a screenshot showing the incorrect rendering.