The tainted canvas

suggest change

When 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents