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

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Posts: 1
Joined: 2013-08-12T07:25:41-07:00
Authentication code: 6789

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

Post by sankit123 » 2013-08-12T07:42:33-07:00

I am trying to convert svgfile.svg to jpgfile.jpg using ImageMagick .


Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg style="overflow: hidden; position: relative;" xmlns=""   xmlns: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="">
<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">
so I use command : convert svgfile.svg jpgfile.jpg and check the jpgfile.jpg. It should contain both the rectangle and image ... 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 ... 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.

Posts: 7
Joined: 2013-11-05T17:24:15-07:00
Authentication code: 6789

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

Post by joekarl » 2013-11-06T09:25:20-07:00

I'm seeing the same thing but on OSX 10.9.

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

Post Reply