I am getting this error in Chrome and Opera Browsers:
Uncaught SecurityError: Failed to execute \'getImageData\' on \'CanvasRenderingContext2D\': The canvas
When you load your html file from disk using: file://path/to/your/file.html
, then Google Chrome and Opera will raise error at line including: imgData = ctx.getImageData(x1,y1,w,h);
Solution is simple: start web server (apache, nginx) put your html file somewhere at web server and load your html file from: http://localhost/somewhere/file.html
May be this will help, as you have mentioned cross origin so try this,
var UimageObj = new Image();
crossOrigin has to be set to enable the canvas data to be saved.The source image should have access-control-allow-origin
set to *
or a chosen domain
UimageObj.crossOrigin = 'anonymous'; // crossOrigin attribute has to be set before setting src.If reversed, it wont work.
UimageObj.src = obj_data.srcUser;
Hope it helps.