Skip to content

Commit fdf760c

Browse files
committed
Merge pull request exif-js#32 from townxelliot/master
Make getData() more flexible for remote and local images
2 parents 158e351 + 7e88633 commit fdf760c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exif.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@
352352
}
353353
}
354354

355-
if (img instanceof Image || img instanceof HTMLImageElement) {
355+
if (img.src) {
356356
if (/^data\:/i.test(img.src)) { // Data URI
357357
var arrayBuffer = base64ToArrayBuffer(img.src);
358358
handleBinaryFile(arrayBuffer);
@@ -368,7 +368,7 @@
368368
} else {
369369
var http = new XMLHttpRequest();
370370
http.onload = function() {
371-
if (http.status == "200") {
371+
if (this.status == 200 || this.status === 0) {
372372
handleBinaryFile(http.response);
373373
} else {
374374
throw "Could not load image";

0 commit comments

Comments
 (0)