From fbe67cae133afbfffb2741c2a7c3be68c23e3882 Mon Sep 17 00:00:00 2001 From: ivmartel Date: Fri, 6 Mar 2015 21:43:37 +0100 Subject: [PATCH] Check if the responseURL is present before checking the file extension. Some browsers do not provide this url (IE for ex). Relates to #125. --- src/io/url.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/io/url.js b/src/io/url.js index 315f8c201f..3262bae558 100644 --- a/src/io/url.js +++ b/src/io/url.js @@ -77,7 +77,8 @@ dwv.io.Url.prototype.load = function(ioArray) var isGif = view.getUint32(0) === 0x47494638; // check possible extension - if( !isJpeg && !isPng && !isGif ) + // (responseURL is supported on major browsers but not IE...) + if ( !isJpeg && !isPng && !isGif && this.responseURL ) { var ext = this.responseURL.split('.').pop().toLowerCase(); isJpeg = (ext === "jpg") || (ext === "jpeg");