Serious issues with SVG files handling

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
redna379
Posts: 25
Joined: 2007-02-22T21:11:40-07:00

Serious issues with SVG files handling

Post by redna379 »

Hello.
I'm experiencing huge problems with SVG files.
First of all, some infos on my actual versions (btw, i tried also with the very latest one, and all the issues are exactly the same)
convert --version
Version: ImageMagick 6.4.2 08/02/08 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2008 ImageMagick Studio LLC

convert -list format | grep SVG
MSVG SVG rw+ ImageMagick's own SVG internal renderer
SVG SVG rw+ Scalable Vector Graphics (XML 2.6.32)
SVGZ SVG rw+ Compressed Scalable Vector Graphics (XML 2.6.32)
Now, here's the main issue. A simple SVG => PNG conversion like this gives this output:
convert +antialias test.svg test.png
convert: Must specify image size `/tmp/magick-XXvlzGaK'.
convert: missing an image filename `test.png'.
The very same thing happens also when using identify, which i use to determine the SVG file size for a given DPI:
identify --verbose test.svg
identify: Must specify image size `/tmp/magick-XXQCCupc'.

identify +antialias -density 72 -format "%w %h" test.svg
identify: Must specify image size `/tmp/magick-XXCob8xA'.
But, if i try those very same commands using the old IM 6.3.7-3 all is fine, convert works and identify returns fine outputs.
Any hint on how to fix this? What's causing the "Must specify image size" error?

BTW, if needed, this is one of the SVGs i'm trying with:
http://designer.realtimedesigner.com/im ... s/7077.svg

Thank you in advance.
redna379
Posts: 25
Joined: 2007-02-22T21:11:40-07:00

Re: Serious issues with SVG files handling

Post by redna379 »

I tried with both MSVG and RSVG, anyhow generally i use MSVG.
At the end, what i need is to determine the size of an SVG file, given the DPI. SVG files are provided by users, so i cannot know in advance the size them have.

If i add the -size option to the identify command, i simply get, as width and height, the params i passed to -size itself.
but something like:
identify +antialias -density 72 -format "%w %h" msvg:test.svg
works fine with 6.3.7-3.

So my silly question is: is there a way, with 6.4.2, to use identify to find out the width and height of an SVG file at a given DPI?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Serious issues with SVG files handling

Post by anthony »

Something is strange the RSVG programs do seem to be able to extract some width and height info form the initial <svg ....> statment in the file, but IM is not.

I have a feeling that all the 'sodipodi:' parameters that are also present is confusing IM. Or prehaps it is the <!-- ... --> comment that is present just before the <svg ... > tag.

I would report a bug in the bugs forum with the SVG image link you gave above.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
redna379
Posts: 25
Joined: 2007-02-22T21:11:40-07:00

Re: Serious issues with SVG files handling

Post by redna379 »

Thank you very much, i'll wait for news from there
Post Reply