[Pkg-gmagick-im-team] Bug#771047: imagemagick: loads square SVG with a non-square aspect ratio

Simon McVittie smcv at debian.org
Wed Nov 26 10:30:16 UTC 2014


Package: imagemagick
Version: 8:6.8.9.9-3
Severity: normal

If I create this trivial SVG (from ikiwiki's regression tests)

    <svg width="30" height="30"/>

then imagemagick has very strange ideas about its size:

% identify square.svg
square.svg=>/tmp/magick-19348iyfzJCMX4oRz PNG 612x792 612x792+0+0 16-bit sRGB 6.1KB 0.010u 0:00.000
% convert square.svg square.png
% file square.png
square.png: PNG image data, 612 x 792, 8-bit gray+alpha, non-interlaced

That's 20.4 pixels per user coordinate horizontally but 26.4 pixels
per user coordinate vertically, which seems ... odd. It's OK that the
pixels per user coordinate ratio is arbitrary, but I think it's a bug
that the two dimensions get different ratios.

If I set a size in "preserve aspect ratio" mode, the image is scaled
consistently:

% convert -resize 10x10 square.svg square.png
square.png: PNG image data, 8 x 10, 1-bit grayscale, non-interlaced
% convert -resize 10x square.svg square.png
% file square.png
square.png: PNG image data, 10 x 13, 1-bit grayscale, non-interlaced
% convert -resize x10 square.svg square.png
% file square.png
square.png: PNG image data, 8 x 10, 1-bit grayscale, non-interlaced

rsvg-convert and Inkscape do what I would expect, allocating the same number
of pixels per user coordinate unit in each dimension (1 pixel per
user coordinate unit in both cases):

% rsvg-convert -o square.png square.svg
% file square.png
square.png: PNG image data, 30 x 30, 8-bit/color RGBA, non-interlaced
% inkscape square.svg --export-png square.png
Background RRGGBBAA: ffffff00
Area 0:0:30:30 exported to 30 x 30 pixels (90 dpi)
Bitmap saved as: square.png
% file square.png
square.png: PNG image data, 30 x 30, 8-bit/color RGBA, non-interlaced

I get the same result from imagemagick if I try changing the width and
height to 30px or 30cm.

This worked (ikiwiki's tests passed) last time I uploaded ikiwiki, which
I think means it must have regressed since 8:6.8.9.6-4.

-- Package-specific info:
ImageMagick program version
---------------------------
animate:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
compare:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
convert:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
composite:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
conjure:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
display:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
identify:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
import:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
mogrify:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
montage:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org
stream:  ImageMagick 6.8.9-9 Q16 x86_64 2014-11-15 http://www.imagemagick.org

-- System Information:
Debian Release: jessie/sid
  APT prefers proposed-updates
  APT policy: (500, 'proposed-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages imagemagick depends on:
ii  imagemagick-6.q16  8:6.8.9.9-3

imagemagick recommends no packages.

imagemagick suggests no packages.

-- no debconf information



More information about the Pkg-gmagick-im-team mailing list