Answers for "main.js:12 uncaught domexception: failed to execute 'getimagedata' on 'canvasrenderingcontext2d': the canvas has been tainted by cross-origin data. at image.<anonymous> (file:///c:/users/olfa%20landolsi/desktop/canvas/main.js:12:27)"

1

Uncaught DOMException: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data.

// Add below code just after creating the image object
img.crossOrigin = "Anonymous";
Posted by: Guest on September-06-2021

Code answers related to "main.js:12 uncaught domexception: failed to execute 'getimagedata' on 'canvasrenderingcontext2d': the canvas has been tainted by cross-origin data. at image.<anonymous> (file:///c:/users/olfa%20landolsi/desktop/canvas/main.js:12:27)"

Code answers related to "Javascript"

Browse Popular Code Answers by Language