1 decade ago by alexandre
This post carried over from Error running demos locally in Chrome.
My app--on MAMP, Chrome 20.0.X, OSX 10.7--needs to load third-party images via an external URL. So, I did this:
This works as long as ig.system.scale is 1.
The moment it's not, image.js attempts to resize the image after load:
1. it creates a new context
2. draws its (cross-origin) data into it
3. attempts to read the pixels (getImageData),
at which point Chrome complains:
Any advice on how to work around this (other than dumping Chrome) much appreciated.
PS: tried setting crossOrigin to '', and saving incoming data to local storage, but no. Chrome plugged all the loopholes, it seems.
My app--on MAMP, Chrome 20.0.X, OSX 10.7--needs to load third-party images via an external URL. So, I did this:
var url = 'http://some.url.com/pix/001.png'; this.pix = new ig.Image(url);
This works as long as ig.system.scale is 1.
The moment it's not, image.js attempts to resize the image after load:
1. it creates a new context
2. draws its (cross-origin) data into it
3. attempts to read the pixels (getImageData),
at which point Chrome complains:
Unable to get image data from canvas because the canvas has been tainted by cross-origin data. Uncaught Error: SECURITY_ERR: DOM Exception 18
Any advice on how to work around this (other than dumping Chrome) much appreciated.
PS: tried setting crossOrigin to '', and saving incoming data to local storage, but no. Chrome plugged all the loopholes, it seems.