blueimp-canvas-to-blob
Advanced tools
Comparing version 2.2.4 to 3.0.0
@@ -15,4 +15,3 @@ /* | ||
/*jslint nomen: true, regexp: true */ | ||
/*global window, atob, Blob, ArrayBuffer, Uint8Array, define */ | ||
/*global window, atob, Blob, ArrayBuffer, Uint8Array, define, module */ | ||
@@ -106,2 +105,4 @@ (function (window) { | ||
}); | ||
} else if (typeof module === 'object' && module.exports) { | ||
module.exports = dataURLtoBlob; | ||
} else { | ||
@@ -108,0 +109,0 @@ window.dataURLtoBlob = dataURLtoBlob; |
@@ -1,1 +0,1 @@ | ||
!function(t){"use strict";var e=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,n=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),o=n&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,a=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,i=(n||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,i,l,u,B,b,c,f,d;if(e=t.match(a),!e)throw new Error("invalid data URI");for(i=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),l=!!e[4],u=t.slice(e[0].length),B=l?atob(u):decodeURIComponent(u),b=new ArrayBuffer(B.length),c=new Uint8Array(b),f=0;f<B.length;f+=1)c[f]=B.charCodeAt(f);return n?new Blob([o?c:b],{type:i}):(d=new r,d.append(b),d.getBlob(i))};t.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(t,n,o){t(o&&e.toDataURL&&i?i(this.toDataURL(n,o)):this.mozGetAsFile("blob",n))}:e.toDataURL&&i&&(e.toBlob=function(t,e,n){t(i(this.toDataURL(e,n)))})),"function"==typeof define&&define.amd?define(function(){return i}):t.dataURLtoBlob=i}(window); | ||
!function(t){"use strict";var e=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,o=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),n=o&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,a=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,i=(o||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,i,l,u,b,c,d,B,f;if(e=t.match(a),!e)throw new Error("invalid data URI");for(i=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),l=!!e[4],u=t.slice(e[0].length),b=l?atob(u):decodeURIComponent(u),c=new ArrayBuffer(b.length),d=new Uint8Array(c),B=0;B<b.length;B+=1)d[B]=b.charCodeAt(B);return o?new Blob([n?d:c],{type:i}):(f=new r,f.append(c),f.getBlob(i))};t.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(t,o,n){t(n&&e.toDataURL&&i?i(this.toDataURL(o,n)):this.mozGetAsFile("blob",o))}:e.toDataURL&&i&&(e.toBlob=function(t,e,o){t(i(this.toDataURL(e,o)))})),"function"==typeof define&&define.amd?define(function(){return i}):"object"==typeof module&&module.exports?module.exports=i:t.dataURLtoBlob=i}(window); |
{ | ||
"name": "blueimp-canvas-to-blob", | ||
"version": "2.2.4", | ||
"version": "3.0.0", | ||
"title": "JavaScript Canvas to Blob", | ||
"description": "JavaScript Canvas to Blob is a function to convert canvas elements into Blob objects.", | ||
"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.", | ||
"keywords": [ | ||
@@ -26,6 +26,7 @@ "javascript", | ||
"jshint": "2.8.0", | ||
"mocha-phantomjs": "4.0.1", | ||
"uglify-js": "2.6.1" | ||
}, | ||
"scripts": { | ||
"test": "jshint js test", | ||
"test": "jshint js test && mocha-phantomjs --ssl-protocol=any test/index.html", | ||
"build": "uglifyjs js/canvas-to-blob.js -c -m > js/canvas-to-blob.min.js", | ||
@@ -32,0 +33,0 @@ "preversion": "npm test", |
@@ -50,3 +50,4 @@ # JavaScript Canvas to Blob | ||
script provides one additional function called **dataURLtoBlob**, which is added | ||
to the global window object if no AMD loader is used to load the script: | ||
to the global window object, unless the library is loaded via a module loader | ||
like RequireJS, Browserify or webpack: | ||
@@ -53,0 +54,0 @@ ```js |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14309
196
85
3