The tainted canvas
suggest changeWhen you draw content from another origin without CORS permission, or from the local file system, the canvas is marked as tainted. Attempting to read the pixel data, or to convert the canvas to a data URL, throws a security error.
var image = new Image();
image.src = "file://myLocalImage.png";
image.onload = function(){
ctx.drawImage(this,0,0);
ctx.getImageData(0,0,canvas.width,canvas.height); // throws a security error
}
This example is only a stub.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents