META-INF.resources.bower_components.blueimp-load-image.js.demo.demo.min.js Maven / Gradle / Ivy
$(function(){var j=$("#result");var a=$("#exif");var f=$("#thumbnail");var c=$("#actions");var d;var i;function e(n){var q=n.get("Thumbnail");var l=n.getAll();var m=a.find("table").empty();var o=$(" ");var k=$(" ");var p;if(q){f.empty();loadImage(q,function(r){f.append(r).show()},{orientation:n.get("Orientation")})}for(p in l){if(l.hasOwnProperty(p)){m.append(o.clone().append(k.clone().text(p)).append(k.clone().text(l[p])))}}a.show()}function g(m,o){var p=d.name;var l=m.src;var k;var n;if(!(m.src||m instanceof HTMLCanvasElement)){n=$("Loading image file failed")}else{if(!l){l=m.toDataURL(d.type+"REMOVEME");k="data:"+d.type;if(l.slice(0,k.length)!==k){p=p.replace(/\.\w+$/,".png")}}n=$('').append(m).attr("download",p).attr("href",l)}j.children().replaceWith(n);if(m.getContext){c.show()}if(o&&o.exif){e(o.exif)}}function b(l,k){d=l;if(!loadImage(l,g,k)){j.children().replaceWith($("Your browser does not support the URL or FileReader API."))}}function h(n){n.preventDefault();n=n.originalEvent;var m=n.dataTransfer||n.target;var l=m&&m.files&&m.files[0];var k={maxWidth:j.width(),canvas:true,pixelRatio:window.devicePixelRatio,downsamplingRatio:0.5,orientation:true};if(!l){return}a.hide();f.hide();b(l,k)}if(window.createObjectURL||window.URL||window.webkitURL||window.FileReader){j.children().hide()}$(document).on("dragover",function(k){k.preventDefault();k=k.originalEvent;k.dataTransfer.dropEffect="copy"}).on("drop",h);$("#file-input").on("change",h);$("#edit").on("click",function(l){l.preventDefault();var m=j.find("img, canvas");var k=m[0];var n=window.devicePixelRatio||1;m.Jcrop({setSelect:[40,40,(k.width/n)-40,(k.height/n)-40],onSelect:function(o){i=o},onRelease:function(){i=null}}).parent().on("click",function(o){o.preventDefault()})});$("#crop").on("click",function(l){l.preventDefault();var k=j.find("img, canvas")[0];var m=window.devicePixelRatio||1;if(k&&i){g(loadImage.scale(k,{left:i.x*m,top:i.y*m,sourceWidth:i.w*m,sourceHeight:i.h*m,minWidth:j.width(),maxWidth:j.width(),pixelRatio:m,downsamplingRatio:0.5}));i=null}})});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy