Amazon S3 image cannot be saved using html5 canvas gives Tainted Canvases Error

0 votes

When I load a hosted image in html5 canvas, an error is shown in canvas (though only in Chome, not Firefox), the image is from the Amazon S3 server:


Image from origin 'https://xxx.s3.amazonaws.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'http://localhost:9015' is therefore not allowed access.


And when I try to save the canvas as an image,

Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.


Well yes, I have set the CORS config,

<?xml version="1.0" encoding="UTF-8"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>*</AllowedOrigin> <AllowedMethod>GET</AllowedMethod> <AllowedHeader>*</AllowedHeader> </CORSRule> </CORSConfiguration>

And
 

img.crossOrigin = 'something'
Apr 12, 2022 in IoT (Internet of Things) by Soham
• 9,700 points
952 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In IoT (Internet of Things)

0 votes
1 answer

Android AllJoyn: Connection with second machine gives error of BusAttachement

Why dont you create two Interfaces, one ...READ MORE

answered Jul 25, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
555 views
0 votes
1 answer

RPi2 PsSession: Warning - “Command 'iotstartup' cannot be found”

iotstartup such as setcomputername are executables. So, use ...READ MORE

answered Nov 28, 2018 in IoT (Internet of Things) by DataKing99
• 8,240 points
539 views
0 votes
1 answer

Pico PRO Market Kit : Cannot flash IoT image

Looked int flash-all.bat script which says: The fastboot executable must ...READ MORE

answered Dec 5, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
491 views
0 votes
1 answer

Windows 10 IOT Core: real-time image processing DLL using C++

Yes, but it requires some work. The C++ ...READ MORE

answered Jan 28, 2019 in IoT (Internet of Things) by Upasana
• 8,620 points
1,388 views
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP