saveSvgAsPng icon indicating copy to clipboard operation
saveSvgAsPng copied to clipboard

Blank PNG when exporting with image tag

Open ElMaghri opened this issue 6 years ago • 2 comments

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 ?

ElMaghri avatar Mar 16 '18 10:03 ElMaghri

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.

exupero avatar Mar 16 '18 11:03 exupero

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.

rasmuskaae avatar Mar 27 '18 06:03 rasmuskaae