SVG to PNG convert is offset

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Fibericon
Posts: 3
Joined: 2011-08-03T00:54:49-07:00
Authentication code: 8675308

SVG to PNG convert is offset

Post by Fibericon »

I'm using ImageMagick-6.5.4.7-6.el6_2.x86_64, which is the latest package I can get with yum. The OS is Redhat 2.6.32-220.17.1.el6.x86_64. The problem I'm facing is that when I convert a SVG to a PNG or JPG, the image is offset. For instance, I'll get just the top left corner. Here are the SVG and PNG to compare:

http://cloud.ideawallets.com/testserv/a ... sketch.png
http://cloud.ideawallets.com/testserv/a ... sketch.svg

Here are the commands I attempted:

Code: Select all

convert sketch.svg sketch.png
convert -size 600X400 sketch.svg sketch.png
convert -size 600X400! sketch.svg sketch.png
convert -size 600x400 sketch.svg sketch.png
convert -resize 600x400 sketch.svg sketch.png
They all have similar results. Is it a problem on my end, or an actual bug?
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: SVG to PNG convert is offset

Post by glennrp »

The current version of ImageMagick (6.7.7-2) produces correct output. I'm not positioned to test old versions with SVG conveniently, but I guess that the +repage option might work with your version.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: SVG to PNG convert is offset

Post by fmw42 »

glennrp wrote:The current version of ImageMagick (6.7.7-2) produces correct output. I'm not positioned to test old versions with SVG conveniently, but I guess that the +repage option might work with your version.

I tried with both IM 6.7.7.2 and IM 6.7.4.10 and they both fail to show the whole image. They both show only a small portion (464x210) whether or not I add -size 640x480. +repage does nothing either.

I am on Mac OSX Snow Leopard. Using RSVG 2.34.2

This however does work correctly using the internal SVG.

convert -size 640x480 MSVG:sketch.svg sketch.png

Seems to be a bug with either RSVG or IM's use of RSVG.
Fibericon
Posts: 3
Joined: 2011-08-03T00:54:49-07:00
Authentication code: 8675308

Re: SVG to PNG convert is offset

Post by Fibericon »

fmw42 wrote:
glennrp wrote:The current version of ImageMagick (6.7.7-2) produces correct output. I'm not positioned to test old versions with SVG conveniently, but I guess that the +repage option might work with your version.

I tried with both IM 6.7.7.2 and IM 6.7.4.10 and they both fail to show the whole image. They both show only a small portion (464x210) whether or not I add -size 640x480. +repage does nothing either.

I am on Mac OSX Snow Leopard. Using RSVG 2.34.2

This however does work correctly using the internal SVG.

convert -size 640x480 MSVG:sketch.svg sketch.png

Seems to be a bug with either RSVG or IM's use of RSVG.
Using MSVG worked perfectly. Thanks for the help.
Post Reply