简体   繁体   中英

HTML5/JS - Hitting an error while exporting canvas to PNG - images from other severs

I have made Catifier.com recently, and once the user sets their own background image, you can no longer export the canvas, do it built in safety precautions.

I have been trying for a few days to get another way to save, but just can't find anything.

Does anyone know of a totally different way to export the canvas as an image without using toDataURL?

Any help or links would be greatly appreciated!

Could you not just run the external images through a script on your domain (taking suitable precautions against DOS attacks) and hence bypass this issue? Otherwise I think the answer is most probably no (and if this was not the case, it would probably be counted as a browser bug; see: http://simonsarris.com/blog/480-understanding-the-html5-canvas-image-security-rules etc). The server-side solution should however be viable.

Also see: Save canvas with external images to local file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM