I would like to convert a simple svg graphic to a jpeg one. Here is the svg source code:
<svg style="overflow: hidden; position: relative;"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="300" version="1.1" height="200">
<image x="10" y="10" width="276" height="110"
xlink:href="http://images.google.com/intl/de_ALL/images/logos/images_logo_lg.gif"
stroke-width="1"></image>
<rect x="0" y="150" height="10" width="300" style="fill: #000000"/>
</svg>
If i do the conversion on my windows XP mashine with ImageMagick 6.7.8 all is working fine.
convert test.svg test.jpg
If i do the same conversion on my linux server (Debian 6.0 ImageMagick 6.6.0) get only the black line.
I tried to upgrade to the latest Imagemagick version on my linux mashine but i get no newer version from the repository.
But i'm not sure if the use of external images is a feature from the newer version, or if it is a configuration issue.
Thanks for any suggestions!
You might want to check your version with
convert --version
the following version happily does the intended conversion:
Version: ImageMagick 6.7.7-0 2012-05-27 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenCL
It is available in the current macports port.
This version:
Version: ImageMagick 6.6.9-7 2012-04-30 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
In Ubuntu 12.04 LTS did not work ...
@Wolfgang
I have almost the same verison of imagemagick as yours. (The release is not the same, but I don't think that will cause problem)
$ convert --version
Version: ImageMagick 6.6.9-7 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
And my system is :
Distributor ID: Ubuntu
Description: Ubuntu-Secure-Remix 12.04.1 LTS 31.08.2012
Release: 12.04
Codename: precise
I have tested in my system, it works well the command.
Or it exist another command :
rsvg-convert
It could be installed by type (in Ubuntu) :
apt-get install librsvg2-bin
And to convert a SVG to PNG, the command is :
rsvg-convert your_file.svg > your_file.png
If there is no newer version in the Debian repository, your options are:
Compile it yourself from the ImageMagick source code. Instructions are here.
Install a pre-compiled non-Debian binary package (.tar.gz).
Use Google and search for the official Debian Squeeze (a.k.a. 6.0) 'backport' repository. If you are lucky, there may be a newer ImageMagick available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With