diff options
author | Sem <sembrestels@riseup.net> | 2012-07-31 09:28:14 +0200 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-07-31 09:28:14 +0200 |
commit | e0879bc60015ab6be470b6828da0e50a7399bb9b (patch) | |
tree | d2d716da2453779f2bdbe525bf84bdf0dccf6a2c /vendors/jquery-file-upload/js/vendor/load-image.min.js | |
parent | d00e34131d6177f6d22eb3cf32c50216820aafba (diff) | |
download | elgg-e0879bc60015ab6be470b6828da0e50a7399bb9b.tar.gz elgg-e0879bc60015ab6be470b6828da0e50a7399bb9b.tar.bz2 |
Added some depenences.
Diffstat (limited to 'vendors/jquery-file-upload/js/vendor/load-image.min.js')
-rw-r--r-- | vendors/jquery-file-upload/js/vendor/load-image.min.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vendors/jquery-file-upload/js/vendor/load-image.min.js b/vendors/jquery-file-upload/js/vendor/load-image.min.js new file mode 100644 index 000000000..0f7ab3ffe --- /dev/null +++ b/vendors/jquery-file-upload/js/vendor/load-image.min.js @@ -0,0 +1 @@ +(function(a){"use strict";var b=function(a,c,d){var e=document.createElement("img"),f,g;return e.onerror=c,e.onload=function(){g&&(!d||!d.noRevoke)&&b.revokeObjectURL(g),c(b.scale(e,d))},window.Blob&&a instanceof Blob||window.File&&a instanceof File?f=g=b.createObjectURL(a):f=a,f?(e.src=f,e):b.readFile(a,function(a){e.src=a})},c=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;b.scale=function(a,b){b=b||{};var c=document.createElement("canvas"),d=a.width,e=a.height,f=Math.max((b.minWidth||d)/d,(b.minHeight||e)/e);return f>1&&(d=parseInt(d*f,10),e=parseInt(e*f,10)),f=Math.min((b.maxWidth||d)/d,(b.maxHeight||e)/e),f<1&&(d=parseInt(d*f,10),e=parseInt(e*f,10)),a.getContext||b.canvas&&c.getContext?(c.width=d,c.height=e,c.getContext("2d").drawImage(a,0,0,d,e),c):(a.width=d,a.height=e,a)},b.createObjectURL=function(a){return c?c.createObjectURL(a):!1},b.revokeObjectURL=function(a){return c?c.revokeObjectURL(a):!1},b.readFile=function(a,b){if(window.FileReader&&FileReader.prototype.readAsDataURL){var c=new FileReader;return c.onload=function(a){b(a.target.result)},c.readAsDataURL(a),c}return!1},typeof define!="undefined"&&define.amd?define(function(){return b}):a.loadImage=b})(this);
\ No newline at end of file |