[Magick-bugs] SVG style display:none not observed by convert

Chip Webber chipwebber at gmail.com
Fri Aug 24 13:36:47 PDT 2007


Hello list!
I am having an issue correctly converting svg with hidden elements to
png/jpg/*.

An svg object may be hidden by specifying "display:none;" in an object's
style.  This hidden object is not displayed in SVG viewers (actually most
SVG viewers, eog is an exception and there may be others).  However when
using ImageMagick (convert) to create a new image, the hidden object is
visible in the converted image.  

Here's my testcase:
- I created a simple drawing in Inkscape with two rectangles - one visible,
one hidden.  Export to plain SVG (included below).
- Using firefox as another SVG viewer I checked to make sure only one
rectangle was visible.  
- Then I converted the svg to png/jpg using the following command:

$ convert drawing.svg drawing.png
$ convert drawing.svg drawing.jpg

- The resulting jpg/png displays the visible rectangle and the *hidden*
rectangle.

So is this simply an unsupported feature of SVG?  Or is this an example of a
new or non-standard feature of SVG.

Here's my version info:
convert -version
Version: ImageMagick 6.3.2 04/05/07

Thanks!
Chip



$ more drawing.svg 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.0"
   width="744.09448"
   height="1052.3622"
   id="svg2">
  <defs
     id="defs4" />
  <g 
     id="layer1">
    <rect
       width="180"
       height="125.71429"
       x="60"
       y="192.36218"
 
style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke
-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:none;"
       id="rect2160" />
    <rect
       width="177.0157"
       height="119.87285"
       x="65.777863"
       y="215.28293"
 
style="fill:#0000ff;fill-rule:evenodd;stroke:#000000;stroke-width:1.12714958
px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       id="rect2162" />
  </g>
</svg>



More information about the Magick-bugs mailing list