Crop and Rotating Preloaded Image in Ionic

Hello!

I’m struggling with a related problem when I’m doing the canvas.toDataURL() step, I’m getting the following error:

Error: Failed to execute ‘toDataURL’ on ‘HTMLCanvasElement’: Tainted canvases may not be exported.

Could you please help me, I don’t know how to overcome it. There are solutions out there that propose doing the following:

var image = new Image();
image.setAttribute('crossOrigin', 'anonymous');
image.src = url;

But I’m deeply confused because I have no idea how’s this related to the canvas object (or to the plugin for that matter)? -Am I to understand that the idea here is to create an Image Object like that one and pass it to the plugin? (because that won’t work).

I hope you guys can help me out with this one!
Regards,

-J