Are relative paths for linking images in SVG files supported?
For example given the two input files "subdir/red.svg":
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100" height="100" viewBox="0 0 100 100" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="10" y="10" width="80" height="80" fill="red"/>
<image x="30" y="30" width="40" height="40" xlink:href="green.svg" preserveAspectRatio="xMidYMid meet"/>
</svg>
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100" height="100" viewBox="0 0 100 100" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="10" y="10" width="80" height="80" fill="green"/>
</svg>
Running the command `convert subdir/red.svg test.png` in the directory above these files, gives the error:
Changing the "subdir/red.svg" file to:"convert: unable to open image `green.svg': No such file or directory @ error/blob.c/OpenBlob/2709."
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100" height="100" viewBox="0 0 100 100" xmlns:xlink="http://www.w3.org/1999/xlink">
<rect x="10" y="10" width="80" height="80" fill="red"/>
<image x="30" y="30" width="40" height="40" xlink:href="file:./green.svg" preserveAspectRatio="xMidYMid meet"/>
</svg>
So I'm guessing they're not currently supported. Is that just because it's not supported or a bug?convert: unable to open image `green.svg': No such file or directory @ error/blob.c/OpenBlob/2709.
convert: no data returned `file:./green.svg' @ error/url.c/ReadURLImage/265.