codepo8 / canvas-masking

Masking images with canvas - Demo http://codepo8.github.io/canvas-masking/
207 stars 34 forks source link

Chrome Console Error And Mask Not Working #9

Open dada78 opened 5 years ago

dada78 commented 5 years ago

I downloaded the example files but the masks aren't showing when viewing in the latest Chrome (Mac). I get a console error:"Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. at HTMLImageElement.mask.onload (file:///Users/cfuller1/Downloads/canvas-masking-master/canvasmask.js:28:33"

No problem in Firefox. Any idea what the issue is? Thanks~

codepo8 commented 5 years ago

Yes, you can’t do that on a file:// url, it needs to be on a https:// one.

Sent from Mail for Windows 10

From: dada78 Sent: Monday, January 7, 2019 5:29 PM To: codepo8/canvas-masking Cc: Subscribed Subject: [codepo8/canvas-masking] Chrome Console Error And Mask Not Working(#9)

I downloaded the example files but the masks aren't showing when viewing in the latest Chrome (Mac). I get a console error:"Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. at HTMLImageElement.mask.onload (file:///Users/cfuller1/Downloads/canvas-masking-master/canvasmask.js:28:33" No problem in Firefox. Any idea what the issue is? Thanks~ — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

codepo8 commented 5 years ago

As you can see, the demo works: https://codepo8.github.io/canvas-masking/

Sent from Mail for Windows 10

From: dada78 Sent: Monday, January 7, 2019 5:29 PM To: codepo8/canvas-masking Cc: Subscribed Subject: [codepo8/canvas-masking] Chrome Console Error And Mask Not Working(#9)

I downloaded the example files but the masks aren't showing when viewing in the latest Chrome (Mac). I get a console error:"Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. at HTMLImageElement.mask.onload (file:///Users/cfuller1/Downloads/canvas-masking-master/canvasmask.js:28:33" No problem in Firefox. Any idea what the issue is? Thanks~ — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

dada78 commented 5 years ago

I see. I thought it would a cross domain issue and enabled CORS on Chrome but wasn't working, but yeah works on server. Thanks!