diff --git a/src/js/utilities.js b/src/js/utilities.js index fe2ec989..bd151e4a 100644 --- a/src/js/utilities.js +++ b/src/js/utilities.js @@ -50,7 +50,7 @@ var newImage; // Modern browsers (ignore Safari, #120 & #509) - if (image.naturalWidth && !IS_SAFARI) { + if (image.naturalWidth && !IS_SAFARI_OR_UIWEBVIEW) { return callback(image.naturalWidth, image.naturalHeight); } @@ -268,7 +268,7 @@ orientation = dataView.getUint16(offset, littleEndian); // Override the orientation with its default value for Safari (#120) - if (IS_SAFARI) { + if (IS_SAFARI_OR_UIWEBVIEW) { dataView.setUint16(offset, 1, littleEndian); } diff --git a/src/js/variables.js b/src/js/variables.js index c6ff69b3..6a6e7ee7 100644 --- a/src/js/variables.js +++ b/src/js/variables.js @@ -65,7 +65,7 @@ // Supports var SUPPORT_CANVAS = $.isFunction($('')[0].getContext); - var IS_SAFARI = navigator && /safari/i.test(navigator.userAgent) && /apple computer/i.test(navigator.vendor); + var IS_SAFARI_OR_UIWEBVIEW = navigator && /(Macintosh|iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent); // Maths var num = Number;