META-INF.resources.bower_components.blueimp-load-image.js.load-image-orientation.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-blueimp-fileupload Show documentation
Show all versions of jwebmp-blueimp-fileupload Show documentation
File Upload widget with multiple file selection, drag and drop support, progress bar, validation and preview images, audio and video for jQuery.
Supports cross-domain, chunked and resumable file uploads.
Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.
(function(a){if(typeof define==="function"&&define.amd){define(["./load-image","./load-image-scale","./load-image-meta"],a)}else{if(typeof module==="object"&&module.exports){a(require("./load-image"),require("./load-image-scale"),require("./load-image-meta"))}else{a(window.loadImage)}}})(function(d){var c=d.hasCanvasOption;var b=d.hasMetaOption;var e=d.transformCoordinates;var a=d.getTransformedOptions;d.hasCanvasOption=function(f){return(!!f.orientation||c.call(d,f))};d.hasMetaOption=function(f){return((f&&f.orientation===true)||b.call(d,f))};d.transformCoordinates=function(k,j){e.call(d,k,j);var h=k.getContext("2d");var l=k.width;var g=k.height;var f=k.style.width;var m=k.style.height;var i=j.orientation;if(!i||i>8){return}if(i>4){k.width=g;k.height=l;k.style.width=m;k.style.height=f}switch(i){case 2:h.translate(l,0);h.scale(-1,1);break;case 3:h.translate(l,g);h.rotate(Math.PI);break;case 4:h.translate(0,g);h.scale(1,-1);break;case 5:h.rotate(0.5*Math.PI);h.scale(1,-1);break;case 6:h.rotate(0.5*Math.PI);h.translate(0,-g);break;case 7:h.rotate(0.5*Math.PI);h.translate(l,-g);h.scale(-1,1);break;case 8:h.rotate(-0.5*Math.PI);h.translate(-l,0);break}};d.getTransformedOptions=function(g,k,l){var h=a.call(d,g,k);var f=h.orientation;var m;var j;if(f===true&&l&&l.exif){f=l.exif.get("Orientation")}if(!f||f>8||f===1){return h}m={};for(j in h){if(h.hasOwnProperty(j)){m[j]=h[j]}}m.orientation=f;switch(f){case 2:m.left=h.right;m.right=h.left;break;case 3:m.left=h.right;m.top=h.bottom;m.right=h.left;m.bottom=h.top;break;case 4:m.top=h.bottom;m.bottom=h.top;break;case 5:m.left=h.top;m.top=h.left;m.right=h.bottom;m.bottom=h.right;break;case 6:m.left=h.top;m.top=h.right;m.right=h.bottom;m.bottom=h.left;break;case 7:m.left=h.bottom;m.top=h.right;m.right=h.top;m.bottom=h.left;break;case 8:m.left=h.bottom;m.top=h.left;m.right=h.top;m.bottom=h.right;break}if(m.orientation>4){m.maxWidth=h.maxHeight;m.maxHeight=h.maxWidth;m.minWidth=h.minHeight;m.minHeight=h.minWidth;m.sourceWidth=h.sourceHeight;m.sourceHeight=h.sourceWidth}return m}});
© 2015 - 2025 Weber Informatics LLC | Privacy Policy