Socket
Socket
Sign inDemoInstall

blueimp-canvas-to-blob

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blueimp-canvas-to-blob - npm Package Compare versions

Comparing version 3.19.0 to 3.20.0

27

js/canvas-to-blob.js

@@ -109,7 +109,24 @@ /*

} 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)))
})
}
}

@@ -116,0 +133,0 @@ }

2

js/canvas-to-blob.min.js

@@ -1,2 +0,2 @@

!function(t){"use strict";var r=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,f=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),b=f&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),d=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,B=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,a=(f||d)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,o,n,r,a,i,l,u,c;if(!(e=t.match(B)))throw new Error("invalid data URI");for(o=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),n=!!e[4],r=t.slice(e[0].length),a=(n?atob:decodeURIComponent)(r),i=new ArrayBuffer(a.length),l=new Uint8Array(i),u=0;u<a.length;u+=1)l[u]=a.charCodeAt(u);return f?new Blob([b?l:i],{type:o}):((c=new d).append(i),c.getBlob(o))};t.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(t,e,o){var n=this;setTimeout(function(){o&&r.toDataURL&&a?t(a(n.toDataURL(e,o))):t(n.mozGetAsFile("blob",e))})}:r.toDataURL&&a&&(r.toBlob=function(t,e,o){var n=this;setTimeout(function(){t(a(n.toDataURL(e,o)))})})),"function"==typeof define&&define.amd?define(function(){return a}):"object"==typeof module&&module.exports?module.exports=a:t.dataURLtoBlob=a}(window);
!function(t){"use strict";var a=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,b=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),f=b&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),B=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,s=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,r=(b||B)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,o,n,a,r,i,l,u,c;if(!(e=t.match(s)))throw new Error("invalid data URI");for(o=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),n=!!e[4],a=t.slice(e[0].length),r=(n?atob:decodeURIComponent)(a),i=new ArrayBuffer(r.length),l=new Uint8Array(i),u=0;u<r.length;u+=1)l[u]=r.charCodeAt(u);return b?new Blob([f?l:i],{type:o}):((c=new B).append(i),c.getBlob(o))};t.HTMLCanvasElement&&!a.toBlob&&(a.mozGetAsFile?a.toBlob=function(t,e,o){var n=this;setTimeout(function(){o&&a.toDataURL&&r?t(r(n.toDataURL(e,o))):t(n.mozGetAsFile("blob",e))})}:a.toDataURL&&r&&(a.msToBlob?a.toBlob=function(t,e,o){var n=this;setTimeout(function(){(e&&"image/png"!==e||o)&&a.toDataURL&&r?t(r(n.toDataURL(e,o))):t(n.msToBlob(e))})}:a.toBlob=function(t,e,o){var n=this;setTimeout(function(){t(r(n.toDataURL(e,o)))})})),"function"==typeof define&&define.amd?define(function(){return r}):"object"==typeof module&&module.exports?module.exports=r:t.dataURLtoBlob=r}(window);
//# sourceMappingURL=canvas-to-blob.min.js.map
{
"name": "blueimp-canvas-to-blob",
"version": "3.19.0",
"version": "3.20.0",
"title": "JavaScript Canvas to Blob",

@@ -5,0 +5,0 @@ "description": "Canvas to Blob is a polyfill for the standard JavaScript canvas.toBlob method. It can be used to create Blob objects from an HTML canvas element.",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc