/** * @description - Configura el parametro de entrada "image" del constructor * * @param {TrimImage} _self - Objeto padre * @param {[image object, String]} image - Imagen a tratar * @param {Function} funcLoadBack - Funcion callback * * @return {imageData object} */ function configureImage( _self, image, funcLoadBack ) { if( $.isString( image ) ) { if( funcLoadBack === undefined ) { _self.image = $.createImage( image ); return; } $.createImage( image, function() { _self.image = this; funcLoadBack.call( this, _self ); }); return; } _self.image = image; //La imagen en este punto ya esta cargada //Llamamos el callBack funcLoadBack.call( image, _self ); }
return function( e ) { var image = $.createImage( e.target.result, function() { addImageToCtx.call( _self, this, x, y, width, height ); }); CacheAtlax.set( fileImage.name, { infoFile: { type: fileImage.type, size: fileImage.size, lastModDate: fileImage.lastModifiedDate }, infoCtx: { image: image, x: x, y: y, width: width || image.width, height: height || image.height } }); };