Page 1 of 1

SVG to JPG/PNG with ImageMagick PHP problem

Posted: 2015-12-03T07:00:12-07:00
by shockwave
Hello,

I'm using ImageMagick with PHP to convert some .svg files to png/jpg and I've a problem with some svgs

Here's the file: https://mega.nz/#!xAdVhDLZ!GzBtP37PPAZf ... qa6R00ShUM

And here's the result of

Code: Select all

convert file.svg file.png
Image

Can someone help me please?

Re: SVG to JPG/PNG with ImageMagick PHP problem

Posted: 2015-12-03T10:22:55-07:00
by fmw42
I have tried to download your svg file using Firefox, Chrome and Opera (latest versions for Mac) and I keep getting a message that my browser is too old. Try uploading to some other place such as dropbox.com

Also what SVG renderer are you using? In order of preference, Inkscape, RSVG and IM internal MSVG/XML.

type

Code: Select all

convert -list format
and see what you have for SVG


SVG SVG rw+ Scalable Vector Graphics (RSVG 2.40.2)

Also always provide your IM version and platform.

Re: SVG to JPG/PNG with ImageMagick PHP problem

Posted: 2015-12-04T03:04:06-07:00
by shockwave
Hi fmw42 thanks for the reply!
I have uploaded the svg on dropbox, here's the link: https://www.dropbox.com/s/9vpfwm0zmpakn ... 9.svg?dl=0

And here's the information you asked me
SVG renderer

Code: Select all

SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.36.1)
System information

Code: Select all

Distributor ID:	Debian
Description:	Debian GNU/Linux 7.1 (wheezy)
Release:	7.1
Codename:	wheezy
IM version

Code: Select all

Version: ImageMagick 6.7.7-10 2012-11-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP 
Should I update my RSVG or use Inkscape?

Re: SVG to JPG/PNG with ImageMagick PHP problem

Posted: 2015-12-04T10:22:50-07:00
by fmw42
I get your same bad result using IM 6.9.2.7 Q16 Mac OSX with RSVG 2.40.2 and libpng 1.6.12_0. I am not an SVG expert. But you could try upgrading to the very latest of RSVG or install Inkscape and see what happens. Your SVG file displays fine in my browser, though.

Perhaps one of the other IM users or developers could examine your SVG file and see what might be the issue.

Re: SVG to JPG/PNG with ImageMagick PHP problem

Posted: 2015-12-04T13:24:28-07:00
by dlemstra
We just upgraded librsvg to the latest version (2.4.12) in the Windows distribution and we still have this issue. It seems that librsvg does not handle '
' properly. When I remove this from your file I get the correct result. You could report a bug here: https://bugzilla.gnome.org/enter_bug.cg ... ct=librsvg. Please add a link to your bugreport in this post if you decide to report it there.

Re: SVG to JPG/PNG with ImageMagick PHP problem

Posted: 2015-12-09T03:24:18-07:00
by shockwave
fmw42 wrote:I get your same bad result using IM 6.9.2.7 Q16 Mac OSX with RSVG 2.40.2 and libpng 1.6.12_0. I am not an SVG expert. But you could try upgrading to the very latest of RSVG or install Inkscape and see what happens. Your SVG file displays fine in my browser, though.

Perhaps one of the other IM users or developers could examine your SVG file and see what might be the issue.
dlemstra wrote:We just upgraded librsvg to the latest version (2.4.12) in the Windows distribution and we still have this issue. It seems that librsvg does not handle '
' properly. When I remove this from your file I get the correct result. You could report a bug here: https://bugzilla.gnome.org/enter_bug.cg ... ct=librsvg. Please add a link to your bugreport in this post if you decide to report it there.
Thanks for the replies. I reported the bug here https://bugzilla.gnome.org/show_bug.cgi?id=759231

Re: SVG to JPG/PNG with ImageMagick PHP problem

Posted: 2015-12-09T03:47:45-07:00
by dlemstra
Thanks for coming to this post. Please let us know when they fixed this issue so we can upgrade librsvg to the latest version for the Windows distribution.