Your IP : 216.73.216.147


Current Path : /home/lejardintz/www/media/foundry/3.1/scripts/
Upload File :
Current File : /home/lejardintz/www/media/foundry/3.1/scripts/image.min.js

!function(){var moduleFactory=function($){var module=this,exports=function(){$.fn.image=function(method){var method=$.Image[method];return method&&method.apply(this[0],$.makeArray(arguments).slice(1))},$.Image={get:function(url){var existingImage="IMG"===this.nodeName,image=$(existingImage?this:new Image),imageLoader=$.Deferred();return image.load(function(){var w,h,r,o;existingImage||image.appendTo("body");var data={width:w=image.width(),height:h=image.height(),aspectRatio:r=w/h,orientation:o=1===r?"square":1>r?"tall":"wide"};
image.css({position:"absolute",left:"-99999px"}).data(data).addClass("orientation-"+o).removeAttr("style"),existingImage||image.detach(),imageLoader.resolve(image,data)}).error(function(){imageLoader.reject()}).attr("src",url),imageLoader},aspectRatio:function(width,height){return $.isPlainObject(width)&&(width=width.width,height=width.height),width/height},orientation:function(width,height){return $.isPlainObject(width)&&(width=width.width,height=width.height),width===height?"square":width>height?"wide":"tall"
},resizeProportionate:function(sourceWidth,sourceHeight,maxWidth,maxHeight,mode){var targetWidth=sourceWidth,targetHeight=sourceHeight,ratio=maxWidth/sourceWidth;targetWidth=sourceWidth*ratio,targetHeight=sourceHeight*ratio;var condition=targetHeight>maxHeight;return"outer"==mode&&(condition=maxHeight>targetHeight),condition&&(ratio=maxHeight/sourceHeight,targetWidth=sourceWidth*ratio,targetHeight=sourceHeight*ratio),{top:(maxHeight-targetHeight)/2,left:(maxWidth-targetWidth)/2,width:targetWidth,height:targetHeight}
},resizeWithin:function(sourceWidth,sourceHeight,maxWidth,maxHeight){return $.Image.resizeProportionate(sourceWidth,sourceHeight,maxWidth,maxHeight,"inner")},resizeToFill:function(sourceWidth,sourceHeight,maxWidth,maxHeight){return $.Image.resizeProportionate(sourceWidth,sourceHeight,maxWidth,maxHeight,"outer")}}};exports(),module.resolveWith(exports)};FD31.module("image",moduleFactory)}();