SVG image preserveAspectRatio support or work-around
Posted: 2010-06-10T16:03:04-07:00
I have a small SVG file which defines how to create a thumbnail from an arbitrary image (I use XSL to fill in the filename) and then I planned on using the command-line convert utility (ImageMagick) against this to make it a JPG. The SVG views fine in FireFox but the JPEG created by ImageMagick appears to disregard preserveAspectRatio in svg:image.
Here is my SVG, you can try it with any ol' source image:
Is there no support for this in ImageMagick, or it's perhaps a bug or in the works? I wasn't sure where to post this particular issue, so maybe it belongs in the developer forum. Any wizards out there have suggestions or work-arounds?
Thanks in advance!
Here is my SVG, you can try it with any ol' source image:
Code: Select all
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="125" height="125" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">
<image xlink:href="full-size-image.jpg" x="0" y="0"
width="125" height="125" preserveAspectRatio="xMidYMin slice" />
<rect x="0" y="0" width="125" height="125" rx="4" ry="4"
stroke="white" stroke-width="3" fill="none" />
</svg>
Thanks in advance!