Skip to content

Commit

Permalink
Upgrade canvas-to-blob vendor dev dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed May 13, 2020
1 parent 0e43714 commit e5dd0b1
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions js/vendor/canvas-to-blob.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,28 @@
})
}
} else if (CanvasPrototype.toDataURL && dataURLtoBlob) {
CanvasPrototype.toBlob = function (callback, type, quality) {
var self = this
setTimeout(function () {
callback(dataURLtoBlob(self.toDataURL(type, quality)))
})
if (CanvasPrototype.msToBlob) {
CanvasPrototype.toBlob = function (callback, type, quality) {
var self = this
setTimeout(function () {
if (
((type && type !== 'image/png') || quality) &&
CanvasPrototype.toDataURL &&
dataURLtoBlob
) {
callback(dataURLtoBlob(self.toDataURL(type, quality)))
} else {
callback(self.msToBlob(type))
}
})
}
} else {
CanvasPrototype.toBlob = function (callback, type, quality) {
var self = this
setTimeout(function () {
callback(dataURLtoBlob(self.toDataURL(type, quality)))
})
}
}
}
}
Expand Down

0 comments on commit e5dd0b1

Please sign in to comment.