svg to png errors

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.
landon.silla

svg to png errors

Post by landon.silla »

I just installed IM with:

Code: Select all

wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar xvfz ImageMagick.tar.gz
cd ImageMagick-6.4.2/
./configure
make
sudo make install
Then i tried to convert something and i got errors:

Code: Select all

convert input.svg out.png
sh: wmf2eps: not found.
convert: Delegate failed `"wmf2eps" -o "%o" "%i"'.
convert: unable to open image `/tmp/magick-a0009855': No such file or directory.
convert: unable to load module `/usr/local/lib/ImageMagick-6.3.9/modules-Q16/coders/svg.la': can't open the module.
convert: unable to open file `/tmp/magick-a0009855': No such file or directory.
convert: missing an image filename `/tmp/tst.eps'.
Then i found some posts that said wmf2eps should be used and libwmf should be installed, so i installed it and now when i try to convert, i get:

Code: Select all

convert mrv_basemap.svg out.png
ERROR: meta.c (179): wmf_header_read: this isn't a wmf file
convert: Delegate failed `"wmf2eps" -o "%o" "%i"'.
convert: unable to open image `/tmp/magick-XXvUDrlv': No such file or directory.
convert: unable to open file `/tmp/magick-XXvUDrlv': No such file or directory.
convert: missing an image filename `out.png'.
can somebody please advise what i need to do to be able to convert from svg to png from the command line?

thanks guys!
landon.silla

Re: svg to png errors

Post by landon.silla »

is anybody here on this forum? hello?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: svg to png errors

Post by fmw42 »

looks like you need to install all the delegate libraries for png, jpg, freetype, gs, tif etc

http://www.imagemagick.org/download/delegates/
http://www.imagemagick.org/script/advan ... lation.php


Type the following:

convert -list configure

and see what the line that starts with DELEGATES says. It should list all the delegates installed that IM knows about. Mine says:

DELEGATES bzlib fontconfig freetype gs jpeg jp2 lcms lqr openexr png tiff x11 xml zlib
tsdineen
Posts: 81
Joined: 2007-01-18T08:45:31-07:00

Re: svg to png errors

Post by tsdineen »

You say you want to convert svg to png, but the delegates is using wmf2eps. The wmf format is entirely different. Are you sure the input.svg is a svg file? If it is, I would say you might be picking up another install of IM.
petercoloney

Re: svg to png errors

Post by petercoloney »

hi,
i want to convert .svg image to .png is it possible to convert svg image to image....
if so let me know the process.... i'm using imagemagick 6.5.4 version.
shabbychef

Re: svg to png errors

Post by shabbychef »

I am also getting this bug; I just uninstalled, then reinstalled imageMagick-6.5.2.9 on an amd64 machine under gentoo; I get the following:

Code: Select all

 $ file tp9a33b48e_32e9_4391_8996_3f5e4ddcd96b.svg
tp9a33b48e_32e9_4391_8996_3f5e4ddcd96b.svg: SVG Scalable Vector Graphics image
$ convert svg:tp9a33b48e_32e9_4391_8996_3f5e4ddcd96b.svg outfile.png
ERROR: meta.c (179): wmf_header_read: this isn't a wmf file
convert: Delegate failed `"wmf2eps" -o "%o" "%i"' @ delegate.c/InvokeDelegate/1032.
convert: unable to open image `/tmp/magick-XX4DVfpA': No such file or directory @ blob.c/OpenBlob/2489.
convert: unable to open file `/tmp/magick-XX4DVfpA': No such file or directory @ constitute.c/ReadImage/542.
convert: missing an image filename `outfile.png' @ convert.c/ConvertImageCommand/2776.
looking at the delegates:

Code: Select all

$ convert -list configure | grep DELEGATES
DELEGATES     bzlib djvu gs gvc jpeg jng png rsvg tiff x11 zlib
I assume that 'rsvg' means 'svg' is supported ('delegated'). I have libwmf-0.2.8.4-r3, but it was not compiled with expat support (XML parsing). could that be the issue? I'm not sure why wmf is being invoked for a svg file, tho...
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: svg to png errors

Post by fmw42 »

I am no expert on installation. But when you run ./configure does that show in the listing the following three lines?

PNG --with-png=yes yes
RSVG --with-rsvg=yes yes
WMF --with-wmf=yes yes

If not, you may want to add those --with... statements to your config command:

-- with-png --with-rsvg --with-wmf

If that does not help, then wait for one of the IM experts to reply.
krikrizzz

Re: svg to png errors

Post by krikrizzz »

Hello, i have a problem with conversion with svg to png too.

a segment fault :

/usr/bin/convert -background none -geometry 120 '/var/www/html/file.svg' '/var/www/html/ddco/images/thumb/file.svg/file.svg.png'
Erreur de segmentation

my delegates is ok :
convert -list configure

Path: /usr/local/lib/ImageMagick-6.5.8/config/configure.xml

Name Value
-------------------------------------------------------------------------------
CC gcc -std=gnu99
CFLAGS -fopenmp -g -O2 -Wall -W -pthread
CONFIGURE ./configure
COPYRIGHT Copyright (C) 1999-2010 ImageMagick Studio LLC
CPPFLAGS -I/usr/local/include/ImageMagick
CXX g++
CXXFLAGS -pthread
DEFS -DHAVE_CONFIG_H
DELEGATES bzlib fontconfig freetype jpeg jng lcms png rsvg tiff x11 xml zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecated --with-quantum-depth=16 --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath=
EXEC-PREFIX /usr/local
HOST i686-pc-linux-gnu
LDFLAGS -L/usr/local/lib
LIB_VERSION 0x658
LIB_VERSION_NUMBER 6,5,8,7
LIBS -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lgomp -lpthread
NAME ImageMagick
PCFLAGS -fopenmp
PREFIX /usr/local
QuantumDepth 16
RELEASE_DATE 2009-12-24
VERSION 6.5.8
WEBSITE http://www.imagemagick.org

Path: [built-in]

Name Value
-------------------------------------------------------------------------------
NAME ImageMagick
can you help me please ?

thank you
shabbychef

Re: svg to png errors

Post by shabbychef »

upgrading to imageMagick-6.5.7.0 on Gentoo does not solve the problem for me:

Code: Select all

$ convert svg:tp0008f031_64f1_4e55_8fe9_1e69d713bebc.svg outfile.png
ERROR: meta.c (179): wmf_header_read: this isn't a wmf file
convert: Delegate failed `"wmf2eps" -o "%o" "%i"' @ delegate.c/InvokeDelegate/1032.
convert: unable to open image `/tmp/magick-XX1fYRx2': No such file or directory @ blob.c/OpenBlob/2480.
convert: unable to open file `/tmp/magick-XX1fYRx2': No such file or directory @ constitute.c/ReadImage/542.
convert: missing an image filename `outfile.png' @ convert.c/ConvertImageCommand/2822.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: svg to png errors

Post by magick »

The 'convert -list configure' command must show that rsvg is associated with the DELEGATES tag. If not, when you build ImageMagick, after you run the configure script, check the last 50 lines or so of output and ensure the RSVG delegate library was validated. If not, see config.log to determine why it was not, fix the problem, and rerun the configure script until the RSVG delegate library is validated. Now rebuild / reinstall ImageMagick. That should permit convert to read SVG images.
shabbychef

Re: svg to png errors

Post by shabbychef »

hmmm, seems ok:

Code: Select all

$ convert -list configure | grep DELEGATES
DELEGATES     bzlib djvu gs gvc jpeg jng lqr mpeg png rsvg tiff x11 zlib
I am guessing this is what you mean by 'associated' with DELEGATES
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: svg to png errors

Post by magick »

Can you post a URL to your SVG image file so we can download it and see if we can reproduce the problem?

Add -debug coder to your command line and see what the debugging info tells you. Post the output here.
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: svg to png errors

Post by dognose »

Code: Select all

#convert rose: rose.svg
Segmentation fault

convert rose.svg rose.png
Segmentation fault
The resulting image looks correct.

convert --version
Version: ImageMagick 6.6.1-10 2010-05-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

DELEGATES bzlib fontconfig freetype gs jpeg jng jp2 lcms lqr mpeg png rsvg tiff x11 xml wmf zlib
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: svg to png errors

Post by magick »

Does the problem persist with the latest release of ImageMagick 6.6.4-10? If so, try building without OpenMP support. Add --disable-openmp to your configure script command line. Now build and install. Does the fault still occur?
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: svg to png errors

Post by dognose »

doesn't fix it. the problem is still there:

Code: Select all

# convert --version
Version: ImageMagick 6.6.4-10 2010-10-13 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features:    

# convert rose: rose.svg
Segmentation fault

Post Reply