linked image in svg does not show

linked image in svg does not show,svg,Svg,I have a problem with svg files, where linked images don't show up when opened with any program. Strange thing is, all has been working fine up to just a few days ago! I did noting to change the files and the referenced image is perfectly fine and sits in the same folder. Now, the following svg just shows an empty black canvas, no matter if I open it with the image viewer, an internet browser or an image processing program: <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <!

I have a problem with svg files, where linked images don't show up when opened with any program. Strange thing is, all has been working fine up to just a few days ago! I did noting to change the files and the referenced image is perfectly fine and sits in the same folder. Now, the following svg just shows an empty black canvas, no matter if I open it with the image viewer, an internet browser or an image processing program:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd.">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="600">
    <title> state0709.svg</title>
    <defs>
        <image id="mol" width="6px" height="3px" xlink:href="PTCDA.svg" />
    </defs>

    <rect x="0" y="0" width="600" height="600" />
    <use x="492" y="250" xlink:href="#mol" />
</svg>

I have absolutely no clue what I broke and why it doesn't work anymore.

Thanks for your help!

EDIT:

Ok, so apparently it is a problem with the scaling of the referenced image. It just takes the top left 6x3 corner and renders that, instead of resizing the image down to 6x3. How do I get the image to resize? I know it did it before... Btw, size of PTCDA.svg is width 200, height 100 px.


#1

Try adding a fill value to the rect.


#2

What do the contents of PTCDA.svg look like?

#3

Hi BigBadaboom. It's just a bunch of colored circles, nothing fancy.

#4

Pure SVG? Ie. no linked images in that file or anything? BTW, you are drawing PICDA.svg at a pretty tiny size (6px x 3px). Was that intentional?

#5

Yes, pure svg, no linked images. The small size is intentional.

#6

Don't know then. All I can say is that it works for me. I would try changing PTCDA to another svg to check it's not a problem with that. Then maybe check file permissions of filename case etc.

#7

Hi, Francis! Thanks for the tip, but sadly, that did not fix it.