Skip to content

Commit 95465cb

Browse files
committed
Use crossOrigin=true on images to allow getImageData/WebGL
If not using crossOrigin=true, the canvas get "tainted" which throws an exception when you want to use it as a WebGL texture or if using getImageData()
1 parent 4b31658 commit 95465cb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/ImageCache.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function Img (src) {
1010
this._img = new Image();
1111
this._img.onload = this.emit.bind(this, 'load');
1212
this._img.onerror = this.emit.bind(this, 'error');
13+
this._img.crossOrigin = true;
1314
this._img.src = src;
1415

1516
// The default impl of events emitter will throw on any 'error' event unless

0 commit comments

Comments
 (0)