Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

imageresizetool

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imageresizetool - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

build/resize.common.js

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

"use strict";!function(t){var n={urltoImage:function(t,e){var a=new Image;a.src=t,a.onload=function(){e(a)}},imagetoCanvas:function(t){var e=document.createElement("canvas"),a=e.getContext("2d");return e.width=t.width,e.height=t.height,a.drawImage(t,0,0,e.width,e.height),e},canvasResizetoFile:function(t,e,a){t.toBlob(function(t){a(t)},"image/jpeg",e)},canvasResizetoDataURL:function(t,e){return t.toDataURL("image/jpeg",e)},filetoDataURL:function(t,e){var a=new FileReader;a.onloadend=function(t){e(t.target.result)},a.readAsDataURL(t)},dataURLtoImage:function(t,e){var a=new Image;a.onload=function(){e(a)},a.src=t},dataURLtoFile:function(t){for(var e=t.split(","),a=e[0].match(/:(.*?);/)[1],n=atob(e[1]),o=n.length,i=new Uint8Array(o);o--;)i[o]=n.charCodeAt(o);return new Blob([i],{type:a})},fileResizetoFile:function(t,e,a){n.filetoDataURL(t,function(t){n.dataURLtoImage(t,function(t){n.canvasResizetoFile(n.imagetoCanvas(t),e,a)})})}};t.imageResizeTool=n}(void 0);
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.imageResizeTool=e()}(void 0,function(){var n={urltoImage:function(t,e){var o=new Image;o.src=t,o.onload=function(){e(o)}},imagetoCanvas:function(t){var e=document.createElement("canvas"),o=e.getContext("2d");return e.width=t.width,e.height=t.height,o.drawImage(t,0,0,e.width,e.height),e},canvasResizetoFile:function(t,e,o){t.toBlob(function(t){o(t)},"image/jpeg",e)},canvasResizetoDataURL:function(t,e){return t.toDataURL("image/jpeg",e)},filetoDataURL:function(t,e){var o=new FileReader;o.onloadend=function(t){e(t.target.result)},o.readAsDataURL(t)},dataURLtoImage:function(t,e){var o=new Image;o.onload=function(){e(o)},o.src=t},dataURLtoFile:function(t){for(var e=t.split(","),o=e[0].match(/:(.*?);/)[1],n=atob(e[1]),a=n.length,i=new Uint8Array(a);a--;)i[a]=n.charCodeAt(a);return new Blob([i],{type:o})},fileResizetoFile:function(t,e,o){n.filetoDataURL(t,function(t){n.dataURLtoImage(t,function(t){n.canvasResizetoFile(n.imagetoCanvas(t),e,o)})})}};return n});

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

"use strict";!function(n){var o={urltoImage:function(t){return new Promise(function(n){var e=new Image;e.src=t,e.onload=function(){n(e)}})},imagetoCanvas:function(o){return new Promise(function(n){var e=document.createElement("canvas"),t=e.getContext("2d");e.width=o.width,e.height=o.height,t.drawImage(o,0,0,e.width,e.height),n(e)})},canvasResizetoFile:function(n,t){return new Promise(function(e){n.toBlob(function(n){e(n)},"image/jpeg",t)})},canvasResizetoDataURL:function(e,t){return new Promise(function(n){n(e.toDataURL("image/jpeg",t))})},filetoDataURL:function(t){return new Promise(function(e){var n=new FileReader;n.onloadend=function(n){e(n.target.result)},n.readAsDataURL(t)})},dataURLtoImage:function(t){return new Promise(function(n){var e=new Image;e.onload=function(){n(e)},e.src=t})},dataURLtoFile:function(r){return new Promise(function(n){for(var e=r.split(","),t=e[0].match(/:(.*?);/)[1],o=atob(e[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);n(new Blob([a],{type:t}))})},fileResizetoFile:function(n,e,t){o.filetoDataURL(n).then(function(n){return o.dataURLtoImage(n)}).then(function(n){return o.imagetoCanvas(n)}).then(function(n){return o.canvasResizetoFile(n,e)}).then(function(n){return t(n)})}};n.imageResizeTool=o}(void 0);
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,n){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.imageResizeTool=n()}(void 0,function(){var o={urltoImage:function(t){return new Promise(function(e){var n=new Image;n.src=t,n.onload=function(){e(n)}})},imagetoCanvas:function(o){return new Promise(function(e){var n=document.createElement("canvas"),t=n.getContext("2d");n.width=o.width,n.height=o.height,t.drawImage(o,0,0,n.width,n.height),e(n)})},canvasResizetoFile:function(e,t){return new Promise(function(n){e.toBlob(function(e){n(e)},"image/jpeg",t)})},canvasResizetoDataURL:function(n,t){return new Promise(function(e){e(n.toDataURL("image/jpeg",t))})},filetoDataURL:function(t){return new Promise(function(n){var e=new FileReader;e.onloadend=function(e){n(e.target.result)},e.readAsDataURL(t)})},dataURLtoImage:function(t){return new Promise(function(e){var n=new Image;n.onload=function(){e(n)},n.src=t})},dataURLtoFile:function(a){return new Promise(function(e){for(var n=a.split(","),t=n[0].match(/:(.*?);/)[1],o=atob(n[1]),i=o.length,r=new Uint8Array(i);i--;)r[i]=o.charCodeAt(i);e(new Blob([r],{type:t}))})},fileResizetoFile:function(e,n,t){o.filetoDataURL(e).then(function(e){return o.dataURLtoImage(e)}).then(function(e){return o.imagetoCanvas(e)}).then(function(e){return o.canvasResizetoFile(e,n)}).then(function(e){return t(e)})}};return o});
{
"name": "imageresizetool",
"version": "1.0.0",
"version": "1.0.1",
"description": "简单的易用的js压缩图片方法",

@@ -5,0 +5,0 @@ "main": "index.js",

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

!(function imageResizeTool (root) {
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.imageResizeTool = factory());
}(this, (function () { 'use strict';
var methods = {} ;

@@ -107,3 +112,3 @@

root.imageResizeTool = methods ;
}(this))
return methods ;
})));

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

!(function imageResizeTool (root) {
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.imageResizeTool = factory());
}(this, (function () { 'use strict';
var methods = {} ;

@@ -81,3 +86,3 @@

root.imageResizeTool = methods ;
}(this))
return methods ;
})));
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