SVG to PNG problem

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
mat64

SVG to PNG problem

Post by mat64 »

I recently installed ImageMagick to convert SVG images on Mediawiki. However, images appear incorrect upon conversion as you can see below - I am using SVGs I obtained from Wikipedia and are the same ones used on there.

Image

I have also attempted to convert the image using the command-line, and received the following error which I am guessing contributes to the reason why the converted image is incorrect.

Code: Select all

root@server [~]# convert Edit-clear.svg Edit-clear.png                        
convert: unrecognized color `"#radialGradient3564") rgb(0, 0, 0' @ warning/color.c/QueryMagickColorCompliance/2594.
convert: unable to open image `"#radialGradient3564") rgb(0, 0, 0':  @ error/blob.c/OpenBlob/2517.
convert: no decode delegate for this image format `"#radialGradient3564") rgb(0, 0, 0' @ error/constitute.c/ReadImage/532.
convert: non-conforming drawing primitive definition `fill' @ error/draw.c/DrawImage/3149.
I am using ImageMagick-6.6.3-10, although the same problem appeared with an earlier version I used (6.2?) under Cent OS 5 x86.

I have tried my best to search for a solution for this but I simply cannot find one. Any help would be greatly appreciated, thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: SVG to PNG problem

Post by fmw42 »

I am no expert on this, but did you install the RSVG delegate library and then reinstall IM?

What do you get from

convert -list configure

look at the DELEGATES line!

Mine shows


DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms lqr mpeg openexr png rsvg tiff x11 xml zlib

Though you may not have all of them.


You might also post your svg code (or a link to your file), so others more experienced than I with SVG can examine your syntax
mat64

Re: SVG to PNG problem

Post by mat64 »

Thanks for replying to fast and for providing that command, it lead me on a search and I eventually suppressed the errors by installing librsvg2-devel.i386 and reinstalled ImageMagick using the instructions from here and delegates now shows;

Code: Select all

DELEGATES     fontconfig freetype jpeg jng png rsvg tiff x11 xml zlib
Unfortunately this does not fix my problem, the images are still converted with the same end result as above, although no errors are no longer shown. I'm not sure what you want me to do by your second statement, can you clarify for me exactly what you want me to do? Thanks :)

Edit: I discovered that I wasn't on the version I thought I was, it was a very old version packaged with Cent OS. I'm on version 6.4.8-2 and will having the same problem, I will attempt to upgrade to the latest version tomorrow to see if that resolves it.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: SVG to PNG problem

Post by fmw42 »

Upgrading to the latest version may help.

I was suggesting that you post a link to your file Edit-clear.svg, so others could review your commands.

There are subtle differences between RSVG, IM SVG and these may be version dependent. I am not sure when radial gradients were added. So an upgrade may just be what you need. If not, others with more experience on RSVG vs SVG can help. You could also search the archives in this forum. I am sure there have been a number of questions about radial gradients in SVG before.
mat64

Re: SVG to PNG problem

Post by mat64 »

Just thought I'd update this with what I found the problem was for anyone else who might run into it. For whatever reason, ImageMagick will not convert the svg files I copied from the MediaWiki sites. However once I moved them into Inkscape and saved them as "plain svg", they worked perfectly fine.

Thanks for helping out anyways, fmw42 :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: SVG to PNG problem

Post by fmw42 »

I have had problems with copying code files from web site. It is usually "gremlins" invisible, unprintable characters or it is line endings between PC/MAC/UNIX.

fred
Post Reply