Page MenuHomePhabricator

SVG thumbnail is cropped when displayed at natural size
Open, MediumPublic

Description

Sundance_Raphael reports that natural size SVG thumbnails for a certain image
appear cropped, when rendered with Inkscape or ImageMagick. This was apparently
a regression from 1.9 to 1.10. The source image is:

http://commons.wikimedia.org/wiki/Image:Chlamydomonas.svg

It works fine on commons, so the issue probably does not affect librsvg. There
are screenshots are at:

http://test.wikipedia.org/wiki/User:Sundance_Raphael

By natural size, I mean that no width was specified in the image link.


Version: 1.10.x
Severity: normal
URL: http://test.wikipedia.org/wiki/User:Sundance_Raphael

Details

Reference
bz9832

Related Objects

Event Timeline

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

Sundance_Raphael wrote:

thumbs with a size ending on zero (180px.. ) are ok, if the last numer is
between 1-9 no thumb is generated

Sundance_Raphael wrote:

correction only the thumbs with a size off 200px, 300px were shown and the size
of 177px (orginal size) would shown misformt

Sundance_Raphael wrote:

ImageMagick is the problem. It can show thumbs and svg right with was generated
from Inscape in the MW, but it is not able to reader the .svg right in .png .

Assigning SVG bugs to Ariel -- need a cleanup pass to see what's fixed up by a librsvg upgrade, what can be resolved with fixes to our font configuration, what can be fixed on our end, and what still needs to be pushed upstream.

issue still exists with ImageMagick 6.6.4-0 2010-09-29 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

It also takes imagemagick rather long to render the SVG, so it's probably running into some kind of error situation.

giving SVG bugs back to the pool.

issue still exists with ImageMagick 6.6.4-0 2010-09-29 Q16

How to test this exactly?

(In reply to comment #0)

There are screenshots are at:
http://test.wikipedia.org/wiki/User:Sundance_Raphael

Not anymore. :(

Note that servers reserved an upgrade to Ubuntu 12.04 recently, so testing (or providing instructions how to test) is welcome.

Download http://commons.wikimedia.org/wiki/Image:Chlamydomonas.svg and render with your Mediawiki + ImageMagick (default if there is no rsvg) to convert the svg to png. (Note that Wikimedia uses librsvg for PNG rendering of SVG and not ImageMagick).

I still see this issue with 6.8.0-2 version of ImageMagick on my machine. I'm not really sure if this is an ImageMagick bug, or if we are just not using ImageMagick correctly.

Created attachment 11267
example of IM rendering of file in question.

Attached:

(In reply to Derk-Jan Hartman from comment #9)

Download http://commons.wikimedia.org/wiki/Image:Chlamydomonas.svg and
render with your Mediawiki + ImageMagick (default if there is no rsvg) to
convert the svg to png. (Note that Wikimedia uses librsvg for PNG rendering
of SVG and not ImageMagick).

I still see this issue with 6.8.0-2 version of ImageMagick on my machine.
I'm not really sure if this is an ImageMagick bug, or if we are just not
using ImageMagick correctly.

Seems to work for me on ImageMagick 6.6.0-4 2010-11-16 Q16 for me, but I think my image magick may have been compiled to use rsvg instead of the internal thing.

Tested with: ImageMagick 6.9.0-0 Q16 x86_64 2015-01-12 and still a problem for me.
Full Imagemagick config: P356

rsvg-convert --version
rsvg-convert version 2.40.5

If i interpret this correctly, in this case, it's not handling SVG through the librsvg library, but by way of rsvg-convert.
The command line options it passes might not be enough to generate a proper thumbnail in all cases. When we setup MediaWiki with rsvg, we pass along an explicit target width and height.