possible bug convert SVG to PNG path is filled

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
atdepott
Posts: 2
Joined: 2013-10-16T07:03:59-07:00
Authentication code: 6789

possible bug convert SVG to PNG path is filled

Post by atdepott »

I am trying to convert an SVG image to a PNG using the latest version of ImageMagick (6.8.7 Q16) but I am running into difficulties with rendering a path element. I am using the default SVG renderer (not RSVG). Here is the command I am using:

Code: Select all

convert svgtest2.svg svgtest2.png
and here is the content of my SVG file:

Code: Select all

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="480">
  <path transform="matrix(1,0,0,1,0,0)" fill="none" stroke="#E01B5D" d="M110,129 L180,342 L250,252 L390,67" stroke-width="2"></path>
</svg>
The resulting png should be pink lines with no fill, but I actually see a filled black triangle with no border.
I am very new to ImageMagick so I apologize if this is actually user error. My eventual goal is to convert SVG to PNG using Magick.NET and I will have very limited permissions in the production environment, so I would prefer to use only the default SVG renderer that comes with ImageMagick if possible.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: possible bug convert SVG to PNG path is filled

Post by snibgo »

You need to specify opacities:

Code: Select all

<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="640" height="480">
  <path transform="matrix(1,0,0,1,0,0)"
   fill-opacity="0" stroke-opacity="1"
   fill="none" stroke="#E01B5D"
   d="M110,129 L180,342 L250,252 L390,67" stroke-width="2"></path>
</svg>
snibgo's IM pages: im.snibgo.com
atdepott
Posts: 2
Joined: 2013-10-16T07:03:59-07:00
Authentication code: 6789

Re: possible bug convert SVG to PNG path is filled

Post by atdepott »

Thanks, that solved my problem!
Post Reply