Page MenuHomePhabricator

Lines missing in thumbnail of SVG diagram
Closed, ResolvedPublic


On [[hu:File:Klavám.svg]] three line segments are missing from the thumbnails, even through Firefox displays the image correctly. Manually converting with librsvg 2.36.1 (via this Windows build: did not yield the same error. SVGcheck ( showed the same error as Wikipedia. The SVG validates, and as far as I can see the definition for the missing line segments does not at all differ from the rest.

Version: unspecified
Severity: minor



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:42 AM
bzimport set Reference to bz49061.
bzimport added a subscriber: Unknown Object (MLST).

Thanks for reporting this.

even through Firefox displays the image correctly

Not the case for me. is shown correctly in Google Chrome 27 and Opera 12.14 (and Inkscape 0.48) for me, and incorrectly only in Firefox 21.

Hence I assume that Firefox's SVG rendering is to blame (bug reports should go to ), and that there is no bug on the Wikimedia side.
Do you agree? And if not, I'd love to understand why. :)

For me Firefox 21 (on Win 7) is correct, but even if on some systems it is not, that is, as you say, an upstram bug. The real problem is that the thumbnails generated by MediaWiki are wrong (and on my machine rsvg-convert got it right, so this is not simply a librsvg bug).

(In the meantime, a new version of the file was uploaded; the one I am referring to in the bug report is . I see the same error with new version as well, though.)

(In reply to comment #2)

The real problem is that the thumbnails generated by MediaWiki are wrong

Why do you think so? Why is this not a bug in the library used by Firefox on the specific OS/platform?

so this is not simply a librsvg bug

Not necesarily, if you use a newer version than librsvg 2.36.1 and if there was a bugfix for that (though unlikely).

I used librsvg 2.36.1, as noted in the bug description. Using the same librsvg version on my machine gave a different image than the thumbnail (which was generated by the same version of librsvg, running on the Wikimedia servers) - this problem has nothing whatsoever to do with Firefox. Given that that Inkscape and most browsers give the same result that I got (where all five lines of the pentagon is visible on the left side), it is almost certainly MediaWiki that gets it wrong, and the bug is probably a configuration problem.

gave a different image than the thumbnail

As SVG is not a binary file format, a [[en:diff]] could be interesting then to see the different lines in the file.

Created attachment 12461
result of SVG -> PNG conversion on Win 7 / rsvglib 2.36.1


Created attachment 12462
difference between PNG generated by MediaWiki and PNG generated on a Win 7 machine


I am not sure we are on the same page here :-)

There is an SVG file:
MediaWiki converts it to this thumbnail (using librsvg 2.36.1, if I understand correctly):
My machine (Win 7, also using librsvg 2.36.1) converts it to this image:

These are binary files, so a source diff would not be very instructive, but here is a XOR diff of the images:
As you can see, three lines are missing in the MediaWiki version. (There are some additional tiny differences, though maybe I just did not get the resolution exactly right.)

I tried several different tools, with this result:
lines missing: Wikipedia, librsvg 2.36.1 on Linux (precise64 vagrant box), GIMP
lines there: librsvg 2.36.1 on Windows, Inkscape, Firefox, Chrome, Safari, IE10

I thought maybe the rsvg converter used on Wikimedia sites has some problematic config option set. I'm not familiar with librsvg and don't know how much its behavior depends on configuration, or compilation flags. If you say there is nothing that can be done about this on the Wikimedia side, I'll forward the bug to the librsvg project.

Yeah, I'm sorry for my confusing comments, thanks for clarifying.

I downloaded to a machine with librsvg2-2.34.2-1 and I ran locally

rsvg-convert -f png ~/Klavám.svg -o ~/Klavám.png

GNOME's EOG 3.2 and GIMP 2.6 display the same incorrect PNG image with three missing lines. Both applications use librsvg as far as I know.

Using rsvg-convert on a more recent machine (Fedora 19, librsvg2-tools-2.37.0-3, Firefox 21) the SVG is still wrong in Firefox, but the resulting PNG is correctly displayed in Firefox, and also correctly in GIMP 2.8.

Hence I still think that this is an issue with older versions of librsvg.

The original link to the broken SVG has been deleted.

It also can be found on:

I cannot reproduce this with librsvg 2.36.4 or 2.40.9 but only on Wikipedia or with librsvg 2.36.1.

Aklapper lowered the priority of this task from Low to Lowest.Mar 8 2016, 8:03 PM
Aklapper added a subscriber: Aklapper.

So this is about!Clavam.svg and!Clavam.svg/120px-Clavam.svg.png
Seems to be specifically about the 120px version as others are correct:!Clavam.svg/119px-Clavam.svg.png!Clavam.svg/121px-Clavam.svg.png
Would love to purge but cannot on archived items. :)

Not sure what to do here as it's hard to investigate now without purging (and checking if a newer librsvg version on servers fixed this). Decline? :-/

@Aklapper: I think this can just be closed? is correctly rendered with current librsvg and we can't do anything about the old, archived one.