+ 6

Image data error

I was trying to create some sort of simple Photoshop, but when I used getImageData I got this error. Uncaught SecurityError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': the canvas has been tainted with cross-origin data. It is not a problem with the image, because I have tried multiple. image.crossOrigin = "Anonymous"; gives another error. My guess is that it won't work in SoloLearn, but maybe someone knows how it will work or why it doesn't work.

22nd Jul 2017, 1:49 PM
ChessMaster
ChessMaster - avatar
3 Respostas
+ 4
A <base> tag* comes into documents here, setting the origin to "about:blank". I've looked into this a fair amount and posted / coded workarounds for several cases, but mostly it comes down to "local origin" and a couple workarounds. If there's any way you could provide a "smallest representative sample" that still has the problem​, it may be helpful (hard to say). * https://code.sololearn.com/WVxar9XmY1N4/?ref=app
22nd Jul 2017, 3:17 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
I will check them out later, thank you for your time.
22nd Jul 2017, 2:06 PM
ChessMaster
ChessMaster - avatar