Page 1 of 1

SVG to jpg conversion fails if svg contains http/https urls

Posted: 2013-08-12T07:42:33-07:00
by sankit123
I am trying to convert svgfile.svg to jpgfile.jpg using ImageMagick .

svgfile.svg:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg style="overflow: hidden; position: relative;" xmlns="http://www.w3.org/2000/svg"   xmlns:xlink="http://www.w3.org/1999/xlink" width="794" version="1.1" height="356">
<image transform="matrix(1,0,0,1,0,0)" preserveAspectRatio="none" x="372.171875"  y="110"     width="200" height="235.29411764705884" xlink:href="https://s3-ap-southeast-1.amazonaws.com/fashup/img/item/medium/266652.jpg">
</image>
<rect transform="matrix(1,0,0,1,-106,-4)" x="265.171875" y="176" width="150" height="150" r="0" rx="0" ry="0" fill="#002387" stroke="#000" stroke-width="0">
  </rect>
</svg>
so I use command : convert svgfile.svg jpgfile.jpg and check the jpgfile.jpg. It should contain both the rectangle and image https://s3-ap-southeast-1.amazonaws.com ... 266652.jpg but it only contains the rectangle.



Set-up : Ubuntu 13.04, ImageMagick 6.7.7-10 2013-02-25

Plugin:: Curl, librsvg2 and libxml2 installed. Output of convert -list format | grep "SVG"
MSVG SVG rw+ ImageMagick's own SVG internal renderer
SVG SVG rw+ Scalable Vector Graphics (RSVG 2.36.4)
SVGZ SVG rw+ Compressed Scalable Vector Graphics (RSVG 2.36.4)

What's going wrong: It fails to read the http/https link in the svg file. If i download the file on local the conversion works perfectly. I did strace and checked the logs. It failed to read the url https://s3-ap-southeast-1.amazonaws.com ... 266652.jpg .

Other information: 1. It doesn't work for either http and https .

It works in my laptops having centos(IM 6.5) and mac(IM 6.8)

It also works if I use convert MSVG:svgfile.svg jpgfile.jpg

My guess is that it's failing due to some dependency which is not part of IM, hence it fails to read the urls. Any help is appreciated.

Re: SVG to jpg conversion fails if svg contains http/https u

Posted: 2013-11-06T09:25:20-07:00
by joekarl
I'm seeing the same thing but on OSX 10.9.

Here's my post viewtopic.php?f=1&t=24400