Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/load-image-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}(function (loadImage) {
'use strict'

if ('fetch' in window && 'Request' in window) {
if (typeof fetch !== 'undefined' && typeof Request !== 'undefined') {
loadImage.fetchBlob = function (url, callback, options) {
if (loadImage.hasMetaOption(options)) {
return fetch(new Request(url, options)).then(function (response) {
Expand Down
4 changes: 2 additions & 2 deletions js/load-image-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}(function (loadImage) {
'use strict'

var hasblobSlice = window.Blob && (Blob.prototype.slice ||
var hasblobSlice = typeof Blob !== 'undefined' && (Blob.prototype.slice ||
Blob.prototype.webkitSlice || Blob.prototype.mozSlice)

loadImage.blobSlice = hasblobSlice && function () {
Expand All @@ -55,7 +55,7 @@
var that = this
// 256 KiB should contain all EXIF/ICC/IPTC segments:
var maxMetaDataSize = options.maxMetaDataSize || 262144
var noMetaData = !(window.DataView && file && file.size >= 12 &&
var noMetaData = !(typeof DataView !== 'undefined' && file && file.size >= 12 &&
file.type === 'image/jpeg' && loadImage.blobSlice)
if (noMetaData || !loadImage.readFile(
loadImage.blobSlice.call(file, 0, maxMetaDataSize),
Expand Down
8 changes: 4 additions & 4 deletions js/load-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@
}
// The check for URL.revokeObjectURL fixes an issue with Opera 12,
// which provides URL.createObjectURL but doesn't properly implement it:
var urlAPI = (window.createObjectURL && window) ||
(window.URL && URL.revokeObjectURL && URL) ||
(window.webkitURL && webkitURL)
var urlAPI = ($.createObjectURL && $) ||
($.URL && URL.revokeObjectURL && URL) ||
($.webkitURL && webkitURL)

function revokeHelper (img, options) {
if (img._objectURL && !(options && options.noRevoke)) {
Expand Down Expand Up @@ -135,4 +135,4 @@
} else {
$.loadImage = loadImage
}
}(window))
}(this))