Closed CreatureSurvive closed 2 weeks ago
You’ve done a great job outlining the issue. Currently, embedded SVG images using base64 encoding within the <image>
tag are not supported by lunasvg
. However, this is a valuable feature, and it’s definitely something worth considering for future development. In the meantime, if possible, using direct SVG elements without embedding them as base64 might serve as a workaround.
I'm currently working on writing a wrapper for lunasvg in Swift for use on Apple platforms. One of my primary uses for this will be rendering badges from shields.io. I've managed to get everything working as far as rendering the bitmap data to native image layers. However, I noticed an issue with embedded SVGs wrapped in an image tag that is base64 encoded.
Image tags that are base64 encoded SVG are not handled. For example
<image x="5" y="3" width="14" height="14" xlink:href="data:image/svg+xml;base64,..."/>
However, nested SVGs outside of an image tag are handled correctly. Would it be possible to decode the SVG within the image tag, and render it?This is something readily reproducible in any shields.io badges that include a logo.
(lunasvg
svg2png
)