resvg icon indicating copy to clipboard operation
resvg copied to clipboard

Image element without width and height

Open JoKalliauer opened this issue 3 years ago • 4 comments

I just tested a pretty useless SVG (embedding a completely white png)

svg

<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 515 512" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
 <image xlink:href="data:image/png;base64,  
iVBORw0KGgoAAAANSUhEUgAAAQAAAAEAAQMAAABmvDolAAAAA1BMVEX///+nxBvI AAAAH0lEQVR4Xu3AAQkAAADCMPunNsdhWxwAAAAAAAAAwAEhAAABg2UP5AAAAABJ RU5ErkJggg==
"/>
</svg>

svg

svg

png

resvg librsvg 2.48.9 Inkscape batik
wrong (fully transparent) wrong (fully transparent) correct (left upper corner white) chrashes
2021-05-12S4OcsxCcOscs_rendersvg 2021-05-12S4OcsxCcOscs_librsvg 2021-05-12S4OcsxCcOscs_Inkscape --

System

Fedora 32

JoKalliauer avatar May 21 '21 14:05 JoKalliauer

This is because you haven't set width and height.

My svg test suite already has this case: e-image-026. This is an undefined behaviour. I have no idea how it should be handled.

e-image-026

RazrFalcon avatar May 21 '21 14:05 RazrFalcon

Looks like this is allowed in SVG2: https://www.w3.org/TR/SVG2/geometry.html#Sizing

RazrFalcon avatar May 21 '21 14:05 RazrFalcon

Sorry I thought the PNG-compression is not supported.

JoKalliauer avatar May 21 '21 16:05 JoKalliauer

PNG and JPEG are supported, to some extent.

I leave this issue as part of SVG2 effort.

RazrFalcon avatar May 21 '21 16:05 RazrFalcon