Skip to content

Commit e2600f9

Browse files
committed
Merge pull request #21 from 59naga/IE
Fixed #20
2 parents a500f28 + 95960ef commit e2600f9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dom-pixels.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ var parseDataURI = require('data-uri-to-buffer')
99

1010
function defaultImage(url, cb) {
1111
var img = new Image()
12+
img.crossOrigin = "Anonymous"
1213
img.onload = function() {
1314
var canvas = document.createElement('canvas')
1415
canvas.width = img.width
@@ -64,8 +65,11 @@ function handleGif(data, cb) {
6465

6566
function httpGif(url, cb) {
6667
var xhr = new XMLHttpRequest()
68+
xhr.open('GET', url, true)
6769
xhr.responseType = 'arraybuffer'
68-
xhr.overrideMimeType('application/binary')
70+
if(xhr.overrideMimeType){
71+
xhr.overrideMimeType('application/binary')
72+
}
6973
xhr.onerror = function(err) {
7074
cb(err)
7175
}
@@ -77,7 +81,6 @@ function httpGif(url, cb) {
7781
handleGif(data, cb)
7882
return
7983
}
80-
xhr.open('GET', url, true)
8184
xhr.send()
8285
}
8386

0 commit comments

Comments
 (0)