resvg
resvg copied to clipboard
Image element without width and height
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>
png
resvg | librsvg 2.48.9 | Inkscape | batik |
---|---|---|---|
wrong (fully transparent) | wrong (fully transparent) | correct (left upper corner white) | chrashes |
![]() |
![]() |
![]() |
-- |
System
Fedora 32
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.
Looks like this is allowed in SVG2: https://www.w3.org/TR/SVG2/geometry.html#Sizing
Sorry I thought the PNG-compression is not supported.
PNG and JPEG are supported, to some extent.
I leave this issue as part of SVG2 effort.