Page 1 of 1
Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T15:19:08-07:00
by eleison
I'm using imagemagick to convert svg files to jpg/png on server. Painly it doesn't render the jpg-image correct.
The problem occurs when I use åäö as first letter in the second word. Then it removes the space between the words. Example: jag är en ful älg -> jagär en ful älg.
Image sample:
http://postimg.org/image/z3uhtvcwh/
This is a sample of svg code that renders wrong:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="650px" height="650px" viewBox="0 0 650 650" enable-background="new 0 0 650 650" xml:space="preserve">
<text
transform="translate(197.08643,191.33691)"
id="text5"><tspan
x="-100"
y="0"
style="font-size:60px;fill:#000000;font-family:Arial">jag är jag är</tspan>
</text>
</svg>
Looking at the svg-image in an svg editor displays correct "jag är jag är". I have tried different fonts...
I call imagemagick with: convert 1.svg 1.jpg
Imagemagick version:
Code: Select all
Version: ImageMagick 6.8.0-0 2012-10-11 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
I am very thankful for any help!
( I also posted this on
http://stackoverflow.com/questions/2050 ... -using-aao )
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T15:43:49-07:00
by fmw42
Version: ImageMagick 6.8.0-0 2012-10-11 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP
It would appear that you have no delegates. You would certainly need the jpeg delegate installed to create a jpg output. Also you would be better off using either RSVG or Inkscape delegates for dealing with the svg data rather than IM internal one which I think also needs XML delegate.
What do you get from
convert -list configure
in the line starting with DELEGATES
What platform are you using?
How did you install IM -- from source or binary?
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T15:53:48-07:00
by eleison
Thanks for quick reply!
DELEGATES bzlib freetype jpeg jp2 lcms png tiff x11 xml wmf zlib
Am I missing something?
When converting same svg with inkscape cmd i get no errors.
I'm using windows 7 64bit.
I did install from binary. This was the only version of IM i got to work on my Wampserver configuration for php. :/
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T15:56:06-07:00
by snibgo
I use IM v6.8.7-0 on Windows 7. Using IM internal SVG rendering I get your bad result. But when I use it with Inkscape (v0.48) I get the good result.
As a general rule, Inkscape works better than IM's internal rendering.
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T15:58:51-07:00
by eleison
snibgo wrote:I use IM v6.8.7-0 on Windows 7. Using IM internal SVG rendering I get your bad result. But when I use it with Inkscape (v0.48) I get the good result.
As a general rule, Inkscape works better than IM's internal rendering.
Thank you for letting me know! I was about to install newer version... Hum then I need to figure out how i call Inkscape through my PHP...
Gotta get some sleep now, be back tomorrow! Thanks
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T15:59:32-07:00
by glennrp
fmw42 wrote:
It would appear that you have no delegates. You would certainly need the jpeg delegate installed to create a jpg output. Also you would be better off using either RSVG or Inkscape delegates for dealing with the svg data rather than IM internal one which I think also needs XML delegate.
IM-6.8.0 didn't print a list of delegates (see magick/version.c). Obviously it was able to create jpeg output. The suggestion to use a different SVG renderer is a good one.
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T16:09:05-07:00
by fmw42
Hum then I need to figure out how i call Inkscape through
I do not know if Inkscape is listed as a delegate. But IM needs to know it is there. You can tell by
convert -list format
look at the line for SVG and see which delegate it is using.
I am not using Inkscape, so mine shows RSVG
SVG SVG rw+ Scalable Vector Graphics (
RSVG 2.36.4)
If yours shows MSVG or XML, then you are using the IM internal renderer and need to install Inkscape where IM can find it.
I am a Mac user, but one of the windows users can tell you how to install it and link it to IM.
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T16:14:36-07:00
by eleison
fmw42 wrote:
I do not know if Inkscape is listed as a delegate. But IM needs to know it is there. You can tell by
convert -list format
look at the line for SVG and see which delegate it is using.
I am not using Inkscape, so mine shows RSVG
SVG SVG rw+ Scalable Vector Graphics (RSVG 2.36.4)
If yours shows MSVG or XML, then you are using the IM internal renderer and need to install Inkscape where IM can find it.
I am a Mac user, but one of the windows users can tell you how to install it and link it to IM.
SVG SVG rw+ Scalable Vector Graphics (XML 2.9.0)
Can I link IM with Inkscape? That sounds like good news!
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T16:16:28-07:00
by fmw42
You are using the IM internal renderer for svg which is indicated by XML.
I cannot help on Windows. But one of the others can.
I typically install all my delegates first and then install IM from source on my unix/Mac.
But Windows may be operate differently for delegates. So wait for one of the Windows users to help.
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T16:20:12-07:00
by eleison
fmw42 wrote:You are using the IM internal renderer for svg which is indicated by XML.
I cannot help on Windows. But one of the others can.
I typically install all my delegates first and then install IM from source on my unix/Mac.
But Windows may be operate differently for delegates. So wait for one of the Windows users to help.
The SVG convert turns out correct when you converting? If it does i'm going to sleep well tonight ><
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-10T16:34:17-07:00
by fmw42
I do not have Inkscape, but using RSVG, it works fine for me in IM 6.8.7.9 Q16 Mac OSX
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-11T01:10:03-07:00
by dlemstra
I am planning to integrate librsvg in the windows build and make that the default instead of the internal svg handler. I hope I can spend some time on that this weekend.
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-11T01:18:47-07:00
by eleison
dlemstra wrote:I am planning to integrate librsvg in the windows build and make that the default instead of the internal svg handler. I hope I can spend some time on that this weekend.
Thank you! I use windows as my test environment for a php function I'm building. I'm not sure what kind of imagemagick build i will use on the final server. What kind of server and platform should i look for?
Thanks!
Re: Imagemagick svg to jpg removes space when using åäö
Posted: 2013-12-11T10:56:22-07:00
by snibgo
You might want to try it with Inkscape. For normal use in Windows:
1. Download Inkscape from
http://inkscape.org/en/download/?lang=en and install.
2. Put the Inkscape directory in the system path. (eg "set PATH={inkscape's directory};%PATH%".)
3. IM will now use Inkscape. Check this by converting a SVG file to PNG with "-verbose". It should give the Inkscape command, and should not say MSVG or RSVG.
I don't use PHP, and don't know how to tell PHP to search for files in a given path. The easiest way may be to modify delegates.xml, giving the full path to inkscape.exe.