saveSvgAsPng
saveSvgAsPng copied to clipboard
Blank PNG when exporting with image tag
Hello i work in a project with SVG and i would like to export the whole SVG created by the user as a png. your plugin works pretty fine but when i try to add an image tag inside my SVG and i export it, the plugin gives me a blank png. how can i fix it ?
Thanks for the report. Can you provide some example code that demonstrates the problem? The test page has a very simple example of including an image within an SVG. Here's the XML:
https://github.com/exupero/saveSvgAsPng/blob/115bf91a7eca18cfbe7bc0202c0d02ec7d2b647d/index.html#L156-L158
That does save as a PNG with the image, but I wouldn't be surprised if more complex scenarios fail.
I had the same issue when working locally. Working off a server fixed the issue:
Access to Image at '<filename>' from origin 'null' has been blocked by CORS policy: Invalid response. Origin 'null' is therefore not allowed access.