Perhaps this will help, since you mentioned cross origin, try this,
var UimageObj = new Image();
crossOrigin must be set to enable canvas data storage. The source image must have access-control-allow-origin set to * or the selected domain
UimageObj.crossOrigin = 'anonymous'; // crossOrigin attribute has to be set before setting src.If reversed, it wont work. UimageObj.src = obj_data.srcUser;
Hope this helps.
source share