ngx-image-cropper
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("ngx-image-cropper",["exports","@angular/core","@angular/common","@angular/platform-browser"],e):e((t=t||self)["ngx-image-cropper"]={},t.ng.core,t.ng.common,t.ng.platformBrowser)}(this,(function(t,e,i,r){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t){switch("string"==typeof t&&(t=function(t){var e=new DataView(function(t){t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var e=atob(t),i=e.length,r=new Uint8Array(i),o=0;o<i;o++)r[o]=e.charCodeAt(o);return r.buffer}(t));if(65496!=e.getUint16(0,!1))return-2;var i=e.byteLength,r=2;for(;r<i;){if(e.getUint16(r+2,!1)<=8)return-1;var o=e.getUint16(r,!1);if(r+=2,65505==o){if(1165519206!=e.getUint32(r+=2,!1))return-1;var s=18761==e.getUint16(r+=6,!1);r+=e.getUint32(r+4,s);var a=e.getUint16(r,s);r+=2;for(var n=0;n<a;n++)if(274==e.getUint16(r+12*n,s))return e.getUint16(r+12*n+8,s)}else{if(65280!=(65280&o))break;r+=e.getUint16(r,!1)}}return-1}(t)),t){case 1:return{rotation:0,flipH:!1,flipV:!1};case 2:return{rotation:0,flipH:!0,flipV:!1};case 3:return{rotation:2,flipH:!1,flipV:!1};case 4:return{rotation:2,flipH:!0,flipV:!1};case 5:return{rotation:1,flipH:!1,flipV:!1};case 6:return{rotation:1,flipH:!0,flipV:!1};case 7:return{rotation:3,flipH:!1,flipV:!1};case 8:return{rotation:3,flipH:!0,flipV:!1}}return{rotation:0,flipH:!1,flipV:!1}}var a=function(){function t(t,i,r){this.sanitizer=t,this.cd=i,this.zone=r,this.setImageMaxSizeRetries=0,this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.marginLeft="0px",this.imageVisible=!1,this.format="png",this.outputType="base64",this.maintainAspectRatio=!0,this.aspectRatio=1,this.resizeToWidth=0,this.resizeToHeight=0,this.cropperMinWidth=0,this.cropperMinHeight=0,this.roundCropper=!1,this.onlyScaleDown=!1,this.imageQuality=92,this.autoCrop=!0,this.containWithinAspectRatio=!1,this.cropper={x1:-100,y1:-100,x2:1e4,y2:1e4},this.alignImage="center",this.imageCropped=new e.EventEmitter,this.startCropImage=new e.EventEmitter,this.imageLoaded=new e.EventEmitter,this.cropperReady=new e.EventEmitter,this.loadImageFailed=new e.EventEmitter,this.initCropper()}return Object.defineProperty(t.prototype,"imageChangedEvent",{set:function(t){this.initCropper(),t&&t.target&&t.target.files&&t.target.files.length>0&&this.loadImageFile(t.target.files[0])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageBase64",{set:function(t){this.initCropper(),this.checkExifAndLoadBase64Image(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageFile",{set:function(t){this.initCropper(),t&&this.loadImageFile(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.originalImage&&this.originalImage.complete&&t.containWithinAspectRatio&&this.transformOriginalImage(),t.cropper&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.checkCropperPosition(!1),this.doAutoCrop(),this.cd.markForCheck()),t.aspectRatio&&this.imageVisible&&this.resetCropperPosition()},t.prototype.initCropper=function(){this.imageVisible=!1,this.transformedImage=null,this.safeImgDataUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.moveStart={active:!1,type:null,position:null,x1:0,y1:0,x2:0,y2:0,clientX:0,clientY:0},this.maxSize={width:0,height:0},this.originalSize={width:0,height:0},this.transformedSize={width:0,height:0},this.transformations={rotation:0,flipH:!1,flipV:!1},this.cropper.x1=-100,this.cropper.y1=-100,this.cropper.x2=1e4,this.cropper.y2=1e4},t.prototype.loadImageFile=function(t){var e=this,i=new FileReader;i.onload=function(i){var r=t.type;e.isValidImageType(r)?e.checkExifAndLoadBase64Image(i.target.result):e.loadImageFailed.emit()},i.readAsDataURL(t)},t.prototype.isValidImageType=function(t){return/image\/(png|jpg|jpeg|bmp|gif|tiff)/.test(t)},t.prototype.checkExifAndLoadBase64Image=function(t){var e=this;return new Promise((function(i,r){var o=function(t){e.originalImage=null,e.originalBase64=null,r(t)};e.originalImage=new Image,e.originalImage.onload=function(){e.originalBase64=t,e.transformations=s(t),e.originalSize.width=e.originalImage.naturalWidth,e.originalSize.height=e.originalImage.naturalHeight,e.transformOriginalImage().then((function(){return i()})).catch(o)},e.originalImage.onerror=o,e.originalImage.src=t}))},t.prototype.checkRotation=function(){this.transformations.rotation=this.transformations.rotation%4,this.transformations.rotation<0&&(this.transformations.rotation+=4)},t.prototype.getTransformedSize=function(){if(this.containWithinAspectRatio){if(this.transformations.rotation%2){var t=this.originalSize.width*this.aspectRatio,e=this.originalSize.height/this.aspectRatio;return{width:Math.max(this.originalSize.height,t),height:Math.max(this.originalSize.width,e)}}t=this.originalSize.height*this.aspectRatio,e=this.originalSize.width/this.aspectRatio;return{width:Math.max(this.originalSize.width,t),height:Math.max(this.originalSize.height,e)}}return this.transformations.rotation%2?{height:this.originalSize.width,width:this.originalSize.height}:{width:this.originalSize.width,height:this.originalSize.height}},t.prototype.transformImageBase64=function(){this.checkRotation();var t=this.getTransformedSize(),e=document.createElement("canvas");e.width=t.width,e.height=t.height;var i=e.getContext("2d");return i.setTransform(this.transformations.flipH?-1:1,0,0,this.transformations.flipV?-1:1,e.width/2,e.height/2),i.rotate(Math.PI*(this.transformations.rotation/2)),i.drawImage(this.originalImage,-this.originalSize.width/2,-this.originalSize.height/2),Promise.resolve(e.toDataURL())},t.prototype.setTransformedImage=function(t){var e=this;return new Promise((function(i,r){e.transformedBase64=t,e.safeImgDataUrl=e.sanitizer.bypassSecurityTrustResourceUrl(t),e.transformedImage=new Image,e.transformedImage.onload=function(){e.transformedSize.width=e.transformedImage.naturalWidth,e.transformedSize.height=e.transformedImage.naturalHeight,i(),e.cd.markForCheck()},e.transformedImage.onerror=function(){e.transformedImage=null,r()},e.transformedImage.src=e.transformedBase64}))},t.prototype.transformOriginalImage=function(){var t=this;return this.originalImage&&this.originalImage.complete?this.transformImageBase64().then((function(e){return t.setTransformedImage(e)})):Promise.reject(new Error("No Image Loaded"))},t.prototype.imageLoadedInView=function(){var t=this;null!=this.transformedImage&&(this.imageLoaded.emit(),this.setImageMaxSizeRetries=0,setTimeout((function(){return t.checkImageMaxSizeRecursively()})))},t.prototype.checkImageMaxSizeRecursively=function(){var t=this;this.setImageMaxSizeRetries>40?this.loadImageFailed.emit():this.sourceImage&&this.sourceImage.nativeElement&&this.sourceImage.nativeElement.offsetWidth>0?(this.setMaxSize(),this.setCropperScaledMinSize(),this.resetCropperPosition(),this.cropperReady.emit(),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout((function(){t.checkImageMaxSizeRecursively()}),50))},t.prototype.onResize=function(){this.resizeCropperPosition(),this.setMaxSize(),this.setCropperScaledMinSize()},t.prototype.rotateLeft=function(){return this.transformations.rotation--,this.transformOriginalImage()},t.prototype.rotateRight=function(){return this.transformations.rotation++,this.transformOriginalImage()},t.prototype.flipHorizontal=function(){return this.transformations.flipH=!this.transformations.flipH,this.transformOriginalImage()},t.prototype.flipVertical=function(){return this.transformations.flipV=!this.transformations.flipV,this.transformOriginalImage()},t.prototype.resetImage=function(){this.imageBase64=this.originalBase64},t.prototype.resizeCropperPosition=function(){var t=this.sourceImage.nativeElement;this.maxSize.width===t.offsetWidth&&this.maxSize.height===t.offsetHeight||(this.cropper.x1=this.cropper.x1*t.offsetWidth/this.maxSize.width,this.cropper.x2=this.cropper.x2*t.offsetWidth/this.maxSize.width,this.cropper.y1=this.cropper.y1*t.offsetHeight/this.maxSize.height,this.cropper.y2=this.cropper.y2*t.offsetHeight/this.maxSize.height)},t.prototype.resetCropperPosition=function(){var t=this.sourceImage.nativeElement;if(this.maintainAspectRatio)if(t.offsetWidth/this.aspectRatio<t.offsetHeight){this.cropper.x1=0,this.cropper.x2=t.offsetWidth;var e=t.offsetWidth/this.aspectRatio;this.cropper.y1=(t.offsetHeight-e)/2,this.cropper.y2=this.cropper.y1+e}else{this.cropper.y1=0,this.cropper.y2=t.offsetHeight;var i=t.offsetHeight*this.aspectRatio;this.cropper.x1=(t.offsetWidth-i)/2,this.cropper.x2=this.cropper.x1+i}else this.cropper.x1=0,this.cropper.x2=t.offsetWidth,this.cropper.y1=0,this.cropper.y2=t.offsetHeight;this.doAutoCrop(),this.imageVisible=!0},t.prototype.startMove=function(t,e,i){void 0===i&&(i=null),t.preventDefault(),this.moveStart=o({active:!0,type:e,position:i,clientX:this.getClientX(t),clientY:this.getClientY(t)},this.cropper)},t.prototype.moveImg=function(t){this.moveStart.active&&(t.stopPropagation(),t.preventDefault(),"move"===this.moveStart.type?(this.move(t),this.checkCropperPosition(!0)):"resize"===this.moveStart.type&&(this.resize(t),this.checkCropperPosition(!1)),this.cd.detectChanges())},t.prototype.setMaxSize=function(){if(this.sourceImage){var t=this.sourceImage.nativeElement;this.maxSize.width=t.offsetWidth,this.maxSize.height=t.offsetHeight,this.marginLeft=this.sanitizer.bypassSecurityTrustStyle("calc(50% - "+this.maxSize.width/2+"px)")}},t.prototype.setCropperScaledMinSize=function(){this.transformedImage?(this.setCropperScaledMinWidth(),this.setCropperScaledMinHeight()):(this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20)},t.prototype.setCropperScaledMinWidth=function(){this.cropperScaledMinWidth=this.cropperMinWidth>0?Math.max(20,this.cropperMinWidth/this.transformedImage.width*this.maxSize.width):20},t.prototype.setCropperScaledMinHeight=function(){this.maintainAspectRatio?this.cropperScaledMinHeight=Math.max(20,this.cropperScaledMinWidth/this.aspectRatio):this.cropperMinHeight>0?this.cropperScaledMinHeight=Math.max(20,this.cropperMinHeight/this.transformedImage.height*this.maxSize.height):this.cropperScaledMinHeight=20},t.prototype.checkCropperPosition=function(t){void 0===t&&(t=!1),this.cropper.x1<0&&(this.cropper.x2-=t?this.cropper.x1:0,this.cropper.x1=0),this.cropper.y1<0&&(this.cropper.y2-=t?this.cropper.y1:0,this.cropper.y1=0),this.cropper.x2>this.maxSize.width&&(this.cropper.x1-=t?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=t?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)},t.prototype.moveStop=function(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())},t.prototype.move=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;this.cropper.x1=this.moveStart.x1+e,this.cropper.y1=this.moveStart.y1+i,this.cropper.x2=this.moveStart.x2+e,this.cropper.y2=this.moveStart.y2+i},t.prototype.resize=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;switch(this.moveStart.position){case"left":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth);break;case"topleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"top":this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"topright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"right":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth);break;case"bottomright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottom":this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottomleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight)}this.maintainAspectRatio&&this.checkAspectRatio()},t.prototype.checkAspectRatio=function(){var t=0,e=0;switch(this.moveStart.position){case"top":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"bottom":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topleft":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topright":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"right":case"bottomright":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"left":case"bottomleft":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio)}},t.prototype.doAutoCrop=function(){this.autoCrop&&this.crop()},t.prototype.crop=function(t){if(void 0===t&&(t=this.outputType),this.sourceImage.nativeElement&&null!=this.transformedImage){this.startCropImage.emit();var e=this.getImagePosition(),i=e.x2-e.x1,r=e.y2-e.y1,s=document.createElement("canvas");s.width=i,s.height=r;var a=s.getContext("2d");if(a){null!=this.backgroundColor&&(a.fillStyle=this.backgroundColor,a.fillRect(0,0,i,r)),a.drawImage(this.transformedImage,e.x1,e.y1,i,r,0,0,i,r);var n={width:i,height:r,imagePosition:e,cropperPosition:o({},this.cropper),transform:o({},this.transformations)};this.containWithinAspectRatio&&(n.offsetImagePosition=this.getOffsetImagePosition());var p=this.getResizeRatio(i,r);return 1!==p&&(n.width=Math.round(i*p),n.height=this.maintainAspectRatio?Math.round(n.width/this.aspectRatio):Math.round(r*p),function(t,e,i,r){void 0===r&&(r=!0);var o=t.width,s=t.height,a=o/(e=Math.round(e)),n=s/(i=Math.round(i)),p=Math.ceil(a/2),h=Math.ceil(n/2),c=t.getContext("2d");if(c){for(var m=c.getImageData(0,0,o,s),g=c.createImageData(e,i),l=m.data,u=g.data,d=0;d<i;d++)for(var f=0;f<e;f++){var y=4*(f+d*e),x=d*n,v=0,z=0,S=0,M=0,I=0,b=0,w=0,R=Math.floor(f*a),C=Math.floor(d*n),A=Math.ceil((f+1)*a),H=Math.ceil((d+1)*n);A=Math.min(A,o),H=Math.min(H,s);for(var k=C;k<H;k++)for(var W=Math.abs(x-k)/h,T=f*a,V=W*W,E=R;E<A;E++){var P=Math.abs(T-E)/p,O=Math.sqrt(V+P*P);if(!(O>=1)){var L=4*(E+k*o);w+=(v=2*O*O*O-3*O*O+1)*l[L+3],S+=v,l[L+3]<255&&(v=v*l[L+3]/250),M+=v*l[L],I+=v*l[L+1],b+=v*l[L+2],z+=v}}u[y]=M/z,u[y+1]=I/z,u[y+2]=b/z,u[y+3]=w/S}r?(t.width=e,t.height=i):c.clearRect(0,0,o,s),c.putImageData(g,0,0)}}(s,n.width,n.height)),this.cropToOutputType(t,s,n)}}return null},t.prototype.getImagePosition=function(){var t=this.sourceImage.nativeElement,e=this.transformedSize.width/t.offsetWidth,i={x1:Math.round(this.cropper.x1*e),y1:Math.round(this.cropper.y1*e),x2:Math.round(this.cropper.x2*e),y2:Math.round(this.cropper.y2*e)};return this.containWithinAspectRatio||(i.x1=Math.max(i.x1,0),i.y1=Math.max(i.y1,0),i.x2=Math.min(i.x2,this.transformedSize.width),i.y2=Math.min(i.y2,this.transformedSize.height)),i},t.prototype.getOffsetImagePosition=function(){var t,e,i=this.sourceImage.nativeElement,r=this.transformedSize.width/i.offsetWidth;this.transformations.rotation%2?(t=(this.transformedSize.width-this.originalSize.height)/2,e=(this.transformedSize.height-this.originalSize.width)/2):(t=(this.transformedSize.width-this.originalSize.width)/2,e=(this.transformedSize.height-this.originalSize.height)/2);var o={x1:Math.round(this.cropper.x1*r)-t,y1:Math.round(this.cropper.y1*r)-e,x2:Math.round(this.cropper.x2*r)-t,y2:Math.round(this.cropper.y2*r)-e};return this.containWithinAspectRatio||(o.x1=Math.max(o.x1,0),o.y1=Math.max(o.y1,0),o.x2=Math.min(o.x2,this.transformedSize.width),o.y2=Math.min(o.y2,this.transformedSize.height)),o},t.prototype.cropToOutputType=function(t,e,i){var r=this;switch(t){case"file":return this.cropToFile(e).then((function(t){return i.file=t,r.imageCropped.emit(i),i}));case"both":return i.base64=this.cropToBase64(e),this.cropToFile(e).then((function(t){return i.file=t,r.imageCropped.emit(i),i}));default:return i.base64=this.cropToBase64(e),this.imageCropped.emit(i),i}},t.prototype.cropToBase64=function(t){return t.toDataURL("image/"+this.format,this.getQuality())},t.prototype.cropToFile=function(t){var e=this;return new Promise((function(i){t.toBlob((function(t){return e.zone.run((function(){return i(t)}))}),"image/"+e.format,e.getQuality())}))},t.prototype.getQuality=function(){return Math.min(1,Math.max(0,this.imageQuality/100))},t.prototype.getResizeRatio=function(t,e){if(this.resizeToWidth>0){if(!this.onlyScaleDown||t>this.resizeToWidth)return this.resizeToWidth/t}else if(this.resizeToHeight>0&&(!this.onlyScaleDown||e>this.resizeToHeight))return this.resizeToHeight/e;return 1},t.prototype.getClientX=function(t){return t.touches&&t.touches[0]&&t.touches[0].clientX||t.clientX},t.prototype.getClientY=function(t){return t.touches&&t.touches[0]&&t.touches[0].clientY||t.clientY},t.decorators=[{type:e.Component,args:[{selector:"image-cropper",template:'<div [style.background]="imageVisible && backgroundColor">\n <img\n #sourceImage\n class="source-image"\n [src]="safeImgDataUrl"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n (load)="imageLoadedInView()"\n />\n <div class="cropper"\n *ngIf="imageVisible"\n [class.rounded]="roundCropper"\n [style.top.px]="cropper.y1"\n [style.left.px]="cropper.x1"\n [style.width.px]="cropper.x2 - cropper.x1"\n [style.height.px]="cropper.y2 - cropper.y1"\n [style.margin-left]="alignImage === \'center\' ? marginLeft : null"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n >\n <div\n (mousedown)="startMove($event, \'move\')"\n (touchstart)="startMove($event, \'move\')"\n class="move"\n > </div>\n <span\n class="resize topleft"\n (mousedown)="startMove($event, \'resize\', \'topleft\')"\n (touchstart)="startMove($event, \'resize\', \'topleft\')"\n ><span class="square"></span></span>\n <span\n class="resize top"\n ><span class="square"></span></span>\n <span\n class="resize topright"\n (mousedown)="startMove($event, \'resize\', \'topright\')"\n (touchstart)="startMove($event, \'resize\', \'topright\')"\n ><span class="square"></span></span>\n <span\n class="resize right"\n ><span class="square"></span></span>\n <span\n class="resize bottomright"\n (mousedown)="startMove($event, \'resize\', \'bottomright\')"\n (touchstart)="startMove($event, \'resize\', \'bottomright\')"\n ><span class="square"></span></span>\n <span\n class="resize bottom"\n ><span class="square"></span></span>\n <span\n class="resize bottomleft"\n (mousedown)="startMove($event, \'resize\', \'bottomleft\')"\n (touchstart)="startMove($event, \'resize\', \'bottomleft\')"\n ><span class="square"></span></span>\n <span\n class="resize left"\n ><span class="square"></span></span>\n <span\n class="resize-bar top"\n (mousedown)="startMove($event, \'resize\', \'top\')"\n (touchstart)="startMove($event, \'resize\', \'top\')"\n ></span>\n <span\n class="resize-bar right"\n (mousedown)="startMove($event, \'resize\', \'right\')"\n (touchstart)="startMove($event, \'resize\', \'right\')"\n ></span>\n <span\n class="resize-bar bottom"\n (mousedown)="startMove($event, \'resize\', \'bottom\')"\n (touchstart)="startMove($event, \'resize\', \'bottom\')"\n ></span>\n <span\n class="resize-bar left"\n (mousedown)="startMove($event, \'resize\', \'left\')"\n (touchstart)="startMove($event, \'resize\', \'left\')"\n ></span>\n </div>\n</div>\n',changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[':host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:"";top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}']}]}],t.ctorParameters=function(){return[{type:r.DomSanitizer},{type:e.ChangeDetectorRef},{type:e.NgZone}]},t.propDecorators={sourceImage:[{type:e.ViewChild,args:["sourceImage",{static:!0}]}],imageChangedEvent:[{type:e.Input}],imageBase64:[{type:e.Input}],imageFile:[{type:e.Input}],format:[{type:e.Input}],outputType:[{type:e.Input}],maintainAspectRatio:[{type:e.Input}],aspectRatio:[{type:e.Input}],resizeToWidth:[{type:e.Input}],resizeToHeight:[{type:e.Input}],cropperMinWidth:[{type:e.Input}],cropperMinHeight:[{type:e.Input}],roundCropper:[{type:e.Input}],onlyScaleDown:[{type:e.Input}],imageQuality:[{type:e.Input}],autoCrop:[{type:e.Input}],backgroundColor:[{type:e.Input}],containWithinAspectRatio:[{type:e.Input}],cropper:[{type:e.Input}],alignImage:[{type:e.HostBinding,args:["style.text-align"]},{type:e.Input}],imageCropped:[{type:e.Output}],startCropImage:[{type:e.Output}],imageLoaded:[{type:e.Output}],cropperReady:[{type:e.Output}],loadImageFailed:[{type:e.Output}],onResize:[{type:e.HostListener,args:["window:resize"]}],moveImg:[{type:e.HostListener,args:["document:mousemove",["$event"]]},{type:e.HostListener,args:["document:touchmove",["$event"]]}],moveStop:[{type:e.HostListener,args:["document:mouseup"]},{type:e.HostListener,args:["document:touchend"]}]},t}();var n=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule],declarations:[a],exports:[a]}]}],t}();t.ImageCropperComponent=a,t.ImageCropperModule=n,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define("ngx-image-cropper",["exports","@angular/core","@angular/common","@angular/platform-browser"],e):e((t=t||self)["ngx-image-cropper"]={},t.ng.core,t.ng.common,t.ng.platformBrowser)}(this,(function(t,e,i,r){"use strict";var o=function(){return(o=Object.assign||function(t){for(var e,i=1,r=arguments.length;i<r;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t){switch("string"==typeof t&&(t=function(t){var e=new DataView(function(t){t=t.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var e=atob(t),i=e.length,r=new Uint8Array(i),o=0;o<i;o++)r[o]=e.charCodeAt(o);return r.buffer}(t));if(65496!=e.getUint16(0,!1))return-2;var i=e.byteLength,r=2;for(;r<i;){if(e.getUint16(r+2,!1)<=8)return-1;var o=e.getUint16(r,!1);if(r+=2,65505==o){if(1165519206!=e.getUint32(r+=2,!1))return-1;var s=18761==e.getUint16(r+=6,!1);r+=e.getUint32(r+4,s);var a=e.getUint16(r,s);r+=2;for(var n=0;n<a;n++)if(274==e.getUint16(r+12*n,s))return e.getUint16(r+12*n+8,s)}else{if(65280!=(65280&o))break;r+=e.getUint16(r,!1)}}return-1}(t)),t){case 2:return{rotation:0,flipH:!0,flipV:!1};case 3:return{rotation:2,flipH:!1,flipV:!1};case 4:return{rotation:2,flipH:!0,flipV:!1};case 5:return{rotation:1,flipH:!0,flipV:!1};case 6:return{rotation:1,flipH:!1,flipV:!1};case 7:return{rotation:3,flipH:!0,flipV:!1};case 8:return{rotation:3,flipH:!1,flipV:!1};default:return{rotation:0,flipH:!1,flipV:!1}}}var a=function(){function t(t,i,r){this.sanitizer=t,this.cd=i,this.zone=r,this.setImageMaxSizeRetries=0,this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.marginLeft="0px",this.imageVisible=!1,this.format="png",this.outputType="base64",this.maintainAspectRatio=!0,this.aspectRatio=1,this.resizeToWidth=0,this.resizeToHeight=0,this.cropperMinWidth=0,this.cropperMinHeight=0,this.roundCropper=!1,this.onlyScaleDown=!1,this.imageQuality=92,this.autoCrop=!0,this.containWithinAspectRatio=!1,this.cropper={x1:-100,y1:-100,x2:1e4,y2:1e4},this.alignImage="center",this.imageCropped=new e.EventEmitter,this.startCropImage=new e.EventEmitter,this.imageLoaded=new e.EventEmitter,this.cropperReady=new e.EventEmitter,this.loadImageFailed=new e.EventEmitter,this.initCropper()}return Object.defineProperty(t.prototype,"imageChangedEvent",{set:function(t){this.initCropper(),t&&t.target&&t.target.files&&t.target.files.length>0&&this.loadImageFile(t.target.files[0])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageBase64",{set:function(t){this.initCropper(),this.checkExifAndLoadBase64Image(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageFile",{set:function(t){this.initCropper(),t&&this.loadImageFile(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this.originalImage&&this.originalImage.complete&&t.containWithinAspectRatio&&this.transformOriginalImage(),t.cropper&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.checkCropperPosition(!1),this.doAutoCrop(),this.cd.markForCheck()),t.aspectRatio&&this.imageVisible&&this.resetCropperPosition()},t.prototype.initCropper=function(){this.imageVisible=!1,this.transformedImage=null,this.safeImgDataUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.moveStart={active:!1,type:null,position:null,x1:0,y1:0,x2:0,y2:0,clientX:0,clientY:0},this.maxSize={width:0,height:0},this.originalSize={width:0,height:0},this.transformedSize={width:0,height:0},this.transformations={rotation:0,flipH:!1,flipV:!1},this.cropper.x1=-100,this.cropper.y1=-100,this.cropper.x2=1e4,this.cropper.y2=1e4},t.prototype.loadImageFile=function(t){var e=this,i=new FileReader;i.onload=function(i){var r=t.type;e.isValidImageType(r)?e.checkExifAndLoadBase64Image(i.target.result):e.loadImageFailed.emit()},i.readAsDataURL(t)},t.prototype.isValidImageType=function(t){return/image\/(png|jpg|jpeg|bmp|gif|tiff)/.test(t)},t.prototype.checkExifAndLoadBase64Image=function(t){var e=this;return new Promise((function(i,r){var o=function(t){e.originalImage=null,e.originalBase64=null,r(t)};e.originalImage=new Image,e.originalImage.onload=function(){e.originalBase64=t,e.transformations=s(t),e.originalSize.width=e.originalImage.naturalWidth,e.originalSize.height=e.originalImage.naturalHeight,e.transformOriginalImage().then((function(){return i()})).catch(o)},e.originalImage.onerror=o,e.originalImage.src=t}))},t.prototype.checkRotation=function(){this.transformations.rotation=this.transformations.rotation%4,this.transformations.rotation<0&&(this.transformations.rotation+=4)},t.prototype.getTransformedSize=function(){if(this.containWithinAspectRatio){if(this.transformations.rotation%2){var t=this.originalSize.width*this.aspectRatio,e=this.originalSize.height/this.aspectRatio;return{width:Math.max(this.originalSize.height,t),height:Math.max(this.originalSize.width,e)}}t=this.originalSize.height*this.aspectRatio,e=this.originalSize.width/this.aspectRatio;return{width:Math.max(this.originalSize.width,t),height:Math.max(this.originalSize.height,e)}}return this.transformations.rotation%2?{height:this.originalSize.width,width:this.originalSize.height}:{width:this.originalSize.width,height:this.originalSize.height}},t.prototype.transformImageBase64=function(){this.checkRotation();var t=this.getTransformedSize(),e=document.createElement("canvas");e.width=t.width,e.height=t.height;var i=e.getContext("2d");return i.setTransform(this.transformations.flipH?-1:1,0,0,this.transformations.flipV?-1:1,e.width/2,e.height/2),i.rotate(Math.PI*(this.transformations.rotation/2)),i.drawImage(this.originalImage,-this.originalSize.width/2,-this.originalSize.height/2),Promise.resolve(e.toDataURL())},t.prototype.setTransformedImage=function(t){var e=this;return new Promise((function(i,r){e.transformedBase64=t,e.safeImgDataUrl=e.sanitizer.bypassSecurityTrustResourceUrl(t),e.transformedImage=new Image,e.transformedImage.onload=function(){e.transformedSize.width=e.transformedImage.naturalWidth,e.transformedSize.height=e.transformedImage.naturalHeight,i(),e.cd.markForCheck()},e.transformedImage.onerror=function(){e.transformedImage=null,r()},e.transformedImage.src=e.transformedBase64}))},t.prototype.transformOriginalImage=function(){var t=this;return this.originalImage&&this.originalImage.complete?this.transformImageBase64().then((function(e){return t.setTransformedImage(e)})):Promise.reject(new Error("No Image Loaded"))},t.prototype.imageLoadedInView=function(){var t=this;null!=this.transformedImage&&(this.imageLoaded.emit(),this.setImageMaxSizeRetries=0,setTimeout((function(){return t.checkImageMaxSizeRecursively()})))},t.prototype.checkImageMaxSizeRecursively=function(){var t=this;this.setImageMaxSizeRetries>40?this.loadImageFailed.emit():this.sourceImage&&this.sourceImage.nativeElement&&this.sourceImage.nativeElement.offsetWidth>0?(this.setMaxSize(),this.setCropperScaledMinSize(),this.resetCropperPosition(),this.cropperReady.emit(),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout((function(){t.checkImageMaxSizeRecursively()}),50))},t.prototype.onResize=function(){this.resizeCropperPosition(),this.setMaxSize(),this.setCropperScaledMinSize()},t.prototype.rotateLeft=function(){return this.transformations.rotation--,this.transformOriginalImage()},t.prototype.rotateRight=function(){return this.transformations.rotation++,this.transformOriginalImage()},t.prototype.flipHorizontal=function(){return this.transformations.flipH=!this.transformations.flipH,this.transformOriginalImage()},t.prototype.flipVertical=function(){return this.transformations.flipV=!this.transformations.flipV,this.transformOriginalImage()},t.prototype.resetImage=function(){this.imageBase64=this.originalBase64},t.prototype.resizeCropperPosition=function(){var t=this.sourceImage.nativeElement;this.maxSize.width===t.offsetWidth&&this.maxSize.height===t.offsetHeight||(this.cropper.x1=this.cropper.x1*t.offsetWidth/this.maxSize.width,this.cropper.x2=this.cropper.x2*t.offsetWidth/this.maxSize.width,this.cropper.y1=this.cropper.y1*t.offsetHeight/this.maxSize.height,this.cropper.y2=this.cropper.y2*t.offsetHeight/this.maxSize.height)},t.prototype.resetCropperPosition=function(){var t=this.sourceImage.nativeElement;if(this.maintainAspectRatio)if(t.offsetWidth/this.aspectRatio<t.offsetHeight){this.cropper.x1=0,this.cropper.x2=t.offsetWidth;var e=t.offsetWidth/this.aspectRatio;this.cropper.y1=(t.offsetHeight-e)/2,this.cropper.y2=this.cropper.y1+e}else{this.cropper.y1=0,this.cropper.y2=t.offsetHeight;var i=t.offsetHeight*this.aspectRatio;this.cropper.x1=(t.offsetWidth-i)/2,this.cropper.x2=this.cropper.x1+i}else this.cropper.x1=0,this.cropper.x2=t.offsetWidth,this.cropper.y1=0,this.cropper.y2=t.offsetHeight;this.doAutoCrop(),this.imageVisible=!0},t.prototype.startMove=function(t,e,i){void 0===i&&(i=null),t.preventDefault(),this.moveStart=o({active:!0,type:e,position:i,clientX:this.getClientX(t),clientY:this.getClientY(t)},this.cropper)},t.prototype.moveImg=function(t){this.moveStart.active&&(t.stopPropagation(),t.preventDefault(),"move"===this.moveStart.type?(this.move(t),this.checkCropperPosition(!0)):"resize"===this.moveStart.type&&(this.resize(t),this.checkCropperPosition(!1)),this.cd.detectChanges())},t.prototype.setMaxSize=function(){if(this.sourceImage){var t=this.sourceImage.nativeElement;this.maxSize.width=t.offsetWidth,this.maxSize.height=t.offsetHeight,this.marginLeft=this.sanitizer.bypassSecurityTrustStyle("calc(50% - "+this.maxSize.width/2+"px)")}},t.prototype.setCropperScaledMinSize=function(){this.transformedImage?(this.setCropperScaledMinWidth(),this.setCropperScaledMinHeight()):(this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20)},t.prototype.setCropperScaledMinWidth=function(){this.cropperScaledMinWidth=this.cropperMinWidth>0?Math.max(20,this.cropperMinWidth/this.transformedImage.width*this.maxSize.width):20},t.prototype.setCropperScaledMinHeight=function(){this.maintainAspectRatio?this.cropperScaledMinHeight=Math.max(20,this.cropperScaledMinWidth/this.aspectRatio):this.cropperMinHeight>0?this.cropperScaledMinHeight=Math.max(20,this.cropperMinHeight/this.transformedImage.height*this.maxSize.height):this.cropperScaledMinHeight=20},t.prototype.checkCropperPosition=function(t){void 0===t&&(t=!1),this.cropper.x1<0&&(this.cropper.x2-=t?this.cropper.x1:0,this.cropper.x1=0),this.cropper.y1<0&&(this.cropper.y2-=t?this.cropper.y1:0,this.cropper.y1=0),this.cropper.x2>this.maxSize.width&&(this.cropper.x1-=t?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=t?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)},t.prototype.moveStop=function(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())},t.prototype.move=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;this.cropper.x1=this.moveStart.x1+e,this.cropper.y1=this.moveStart.y1+i,this.cropper.x2=this.moveStart.x2+e,this.cropper.y2=this.moveStart.y2+i},t.prototype.resize=function(t){var e=this.getClientX(t)-this.moveStart.clientX,i=this.getClientY(t)-this.moveStart.clientY;switch(this.moveStart.position){case"left":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth);break;case"topleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"top":this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"topright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y1=Math.min(this.moveStart.y1+i,this.cropper.y2-this.cropperScaledMinHeight);break;case"right":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth);break;case"bottomright":this.cropper.x2=Math.max(this.moveStart.x2+e,this.cropper.x1+this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottom":this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight);break;case"bottomleft":this.cropper.x1=Math.min(this.moveStart.x1+e,this.cropper.x2-this.cropperScaledMinWidth),this.cropper.y2=Math.max(this.moveStart.y2+i,this.cropper.y1+this.cropperScaledMinHeight)}this.maintainAspectRatio&&this.checkAspectRatio()},t.prototype.checkAspectRatio=function(){var t=0,e=0;switch(this.moveStart.position){case"top":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"bottom":this.cropper.x2=this.cropper.x1+(this.cropper.y2-this.cropper.y1)*this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topleft":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"topright":this.cropper.y1=this.cropper.y2-(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(0-this.cropper.y1,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y1+=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"right":case"bottomright":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(this.cropper.x2-this.maxSize.width,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x2-=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio);break;case"left":case"bottomleft":this.cropper.y2=this.cropper.y1+(this.cropper.x2-this.cropper.x1)/this.aspectRatio,t=Math.max(0-this.cropper.x1,0),e=Math.max(this.cropper.y2-this.maxSize.height,0),(t>0||e>0)&&(this.cropper.x1+=e*this.aspectRatio>t?e*this.aspectRatio:t,this.cropper.y2-=e*this.aspectRatio>t?e:t/this.aspectRatio)}},t.prototype.doAutoCrop=function(){this.autoCrop&&this.crop()},t.prototype.crop=function(t){if(void 0===t&&(t=this.outputType),this.sourceImage.nativeElement&&null!=this.transformedImage){this.startCropImage.emit();var e=this.getImagePosition(),i=e.x2-e.x1,r=e.y2-e.y1,s=document.createElement("canvas");s.width=i,s.height=r;var a=s.getContext("2d");if(a){null!=this.backgroundColor&&(a.fillStyle=this.backgroundColor,a.fillRect(0,0,i,r)),a.drawImage(this.transformedImage,e.x1,e.y1,i,r,0,0,i,r);var n={width:i,height:r,imagePosition:e,cropperPosition:o({},this.cropper),transform:o({},this.transformations)};this.containWithinAspectRatio&&(n.offsetImagePosition=this.getOffsetImagePosition());var p=this.getResizeRatio(i,r);return 1!==p&&(n.width=Math.round(i*p),n.height=this.maintainAspectRatio?Math.round(n.width/this.aspectRatio):Math.round(r*p),function(t,e,i,r){void 0===r&&(r=!0);var o=t.width,s=t.height,a=o/(e=Math.round(e)),n=s/(i=Math.round(i)),p=Math.ceil(a/2),h=Math.ceil(n/2),c=t.getContext("2d");if(c){for(var m=c.getImageData(0,0,o,s),g=c.createImageData(e,i),l=m.data,u=g.data,d=0;d<i;d++)for(var f=0;f<e;f++){var y=4*(f+d*e),x=d*n,v=0,z=0,S=0,M=0,I=0,b=0,w=0,R=Math.floor(f*a),C=Math.floor(d*n),A=Math.ceil((f+1)*a),H=Math.ceil((d+1)*n);A=Math.min(A,o),H=Math.min(H,s);for(var k=C;k<H;k++)for(var W=Math.abs(x-k)/h,T=f*a,V=W*W,E=R;E<A;E++){var P=Math.abs(T-E)/p,O=Math.sqrt(V+P*P);if(!(O>=1)){var L=4*(E+k*o);w+=(v=2*O*O*O-3*O*O+1)*l[L+3],S+=v,l[L+3]<255&&(v=v*l[L+3]/250),M+=v*l[L],I+=v*l[L+1],b+=v*l[L+2],z+=v}}u[y]=M/z,u[y+1]=I/z,u[y+2]=b/z,u[y+3]=w/S}r?(t.width=e,t.height=i):c.clearRect(0,0,o,s),c.putImageData(g,0,0)}}(s,n.width,n.height)),this.cropToOutputType(t,s,n)}}return null},t.prototype.getImagePosition=function(){var t=this.sourceImage.nativeElement,e=this.transformedSize.width/t.offsetWidth,i={x1:Math.round(this.cropper.x1*e),y1:Math.round(this.cropper.y1*e),x2:Math.round(this.cropper.x2*e),y2:Math.round(this.cropper.y2*e)};return this.containWithinAspectRatio||(i.x1=Math.max(i.x1,0),i.y1=Math.max(i.y1,0),i.x2=Math.min(i.x2,this.transformedSize.width),i.y2=Math.min(i.y2,this.transformedSize.height)),i},t.prototype.getOffsetImagePosition=function(){var t,e,i=this.sourceImage.nativeElement,r=this.transformedSize.width/i.offsetWidth;this.transformations.rotation%2?(t=(this.transformedSize.width-this.originalSize.height)/2,e=(this.transformedSize.height-this.originalSize.width)/2):(t=(this.transformedSize.width-this.originalSize.width)/2,e=(this.transformedSize.height-this.originalSize.height)/2);var o={x1:Math.round(this.cropper.x1*r)-t,y1:Math.round(this.cropper.y1*r)-e,x2:Math.round(this.cropper.x2*r)-t,y2:Math.round(this.cropper.y2*r)-e};return this.containWithinAspectRatio||(o.x1=Math.max(o.x1,0),o.y1=Math.max(o.y1,0),o.x2=Math.min(o.x2,this.transformedSize.width),o.y2=Math.min(o.y2,this.transformedSize.height)),o},t.prototype.cropToOutputType=function(t,e,i){var r=this;switch(t){case"file":return this.cropToFile(e).then((function(t){return i.file=t,r.imageCropped.emit(i),i}));case"both":return i.base64=this.cropToBase64(e),this.cropToFile(e).then((function(t){return i.file=t,r.imageCropped.emit(i),i}));default:return i.base64=this.cropToBase64(e),this.imageCropped.emit(i),i}},t.prototype.cropToBase64=function(t){return t.toDataURL("image/"+this.format,this.getQuality())},t.prototype.cropToFile=function(t){var e=this;return new Promise((function(i){t.toBlob((function(t){return e.zone.run((function(){return i(t)}))}),"image/"+e.format,e.getQuality())}))},t.prototype.getQuality=function(){return Math.min(1,Math.max(0,this.imageQuality/100))},t.prototype.getResizeRatio=function(t,e){if(this.resizeToWidth>0){if(!this.onlyScaleDown||t>this.resizeToWidth)return this.resizeToWidth/t}else if(this.resizeToHeight>0&&(!this.onlyScaleDown||e>this.resizeToHeight))return this.resizeToHeight/e;return 1},t.prototype.getClientX=function(t){return t.touches&&t.touches[0]&&t.touches[0].clientX||t.clientX},t.prototype.getClientY=function(t){return t.touches&&t.touches[0]&&t.touches[0].clientY||t.clientY},t.decorators=[{type:e.Component,args:[{selector:"image-cropper",template:'<div [style.background]="imageVisible && backgroundColor">\n <img\n #sourceImage\n class="source-image"\n [src]="safeImgDataUrl"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n (load)="imageLoadedInView()"\n />\n <div class="cropper"\n *ngIf="imageVisible"\n [class.rounded]="roundCropper"\n [style.top.px]="cropper.y1"\n [style.left.px]="cropper.x1"\n [style.width.px]="cropper.x2 - cropper.x1"\n [style.height.px]="cropper.y2 - cropper.y1"\n [style.margin-left]="alignImage === \'center\' ? marginLeft : null"\n [style.visibility]="imageVisible ? \'visible\' : \'hidden\'"\n >\n <div\n (mousedown)="startMove($event, \'move\')"\n (touchstart)="startMove($event, \'move\')"\n class="move"\n > </div>\n <span\n class="resize topleft"\n (mousedown)="startMove($event, \'resize\', \'topleft\')"\n (touchstart)="startMove($event, \'resize\', \'topleft\')"\n ><span class="square"></span></span>\n <span\n class="resize top"\n ><span class="square"></span></span>\n <span\n class="resize topright"\n (mousedown)="startMove($event, \'resize\', \'topright\')"\n (touchstart)="startMove($event, \'resize\', \'topright\')"\n ><span class="square"></span></span>\n <span\n class="resize right"\n ><span class="square"></span></span>\n <span\n class="resize bottomright"\n (mousedown)="startMove($event, \'resize\', \'bottomright\')"\n (touchstart)="startMove($event, \'resize\', \'bottomright\')"\n ><span class="square"></span></span>\n <span\n class="resize bottom"\n ><span class="square"></span></span>\n <span\n class="resize bottomleft"\n (mousedown)="startMove($event, \'resize\', \'bottomleft\')"\n (touchstart)="startMove($event, \'resize\', \'bottomleft\')"\n ><span class="square"></span></span>\n <span\n class="resize left"\n ><span class="square"></span></span>\n <span\n class="resize-bar top"\n (mousedown)="startMove($event, \'resize\', \'top\')"\n (touchstart)="startMove($event, \'resize\', \'top\')"\n ></span>\n <span\n class="resize-bar right"\n (mousedown)="startMove($event, \'resize\', \'right\')"\n (touchstart)="startMove($event, \'resize\', \'right\')"\n ></span>\n <span\n class="resize-bar bottom"\n (mousedown)="startMove($event, \'resize\', \'bottom\')"\n (touchstart)="startMove($event, \'resize\', \'bottom\')"\n ></span>\n <span\n class="resize-bar left"\n (mousedown)="startMove($event, \'resize\', \'left\')"\n (touchstart)="startMove($event, \'resize\', \'left\')"\n ></span>\n </div>\n</div>\n',changeDetection:e.ChangeDetectionStrategy.OnPush,styles:[':host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:"";top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}']}]}],t.ctorParameters=function(){return[{type:r.DomSanitizer},{type:e.ChangeDetectorRef},{type:e.NgZone}]},t.propDecorators={sourceImage:[{type:e.ViewChild,args:["sourceImage",{static:!0}]}],imageChangedEvent:[{type:e.Input}],imageBase64:[{type:e.Input}],imageFile:[{type:e.Input}],format:[{type:e.Input}],outputType:[{type:e.Input}],maintainAspectRatio:[{type:e.Input}],aspectRatio:[{type:e.Input}],resizeToWidth:[{type:e.Input}],resizeToHeight:[{type:e.Input}],cropperMinWidth:[{type:e.Input}],cropperMinHeight:[{type:e.Input}],roundCropper:[{type:e.Input}],onlyScaleDown:[{type:e.Input}],imageQuality:[{type:e.Input}],autoCrop:[{type:e.Input}],backgroundColor:[{type:e.Input}],containWithinAspectRatio:[{type:e.Input}],cropper:[{type:e.Input}],alignImage:[{type:e.HostBinding,args:["style.text-align"]},{type:e.Input}],imageCropped:[{type:e.Output}],startCropImage:[{type:e.Output}],imageLoaded:[{type:e.Output}],cropperReady:[{type:e.Output}],loadImageFailed:[{type:e.Output}],onResize:[{type:e.HostListener,args:["window:resize"]}],moveImg:[{type:e.HostListener,args:["document:mousemove",["$event"]]},{type:e.HostListener,args:["document:touchmove",["$event"]]}],moveStop:[{type:e.HostListener,args:["document:mouseup"]},{type:e.HostListener,args:["document:touchend"]}]},t}();var n=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule],declarations:[a],exports:[a]}]}],t}();t.ImageCropperComponent=a,t.ImageCropperModule=n,Object.defineProperty(t,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=ngx-image-cropper.umd.min.js.map |
@@ -27,2 +27,2 @@ /** | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2UtY3JvcHBlZC1ldmVudC5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbImxpYi9pbnRlcmZhY2VzL2ltYWdlLWNyb3BwZWQtZXZlbnQuaW50ZXJmYWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFHQSx1Q0FTQzs7O0lBUkcsbUNBQXVCOztJQUN2QixpQ0FBbUI7O0lBQ25CLGtDQUFjOztJQUNkLG1DQUFlOztJQUNmLDRDQUFpQzs7SUFDakMsMENBQStCOztJQUMvQixnREFBc0M7O0lBQ3RDLHNDQUEyQiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IENyb3BwZXJQb3NpdGlvbiB9IGZyb20gXCIuL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlXCI7XG5pbXBvcnQgeyBUcmFuc2Zvcm1hdGlvbnMgfSBmcm9tICcuL3RyYW5zZm9ybWF0aW9ucy5pbnRlcmZhY2VzJztcblxuZXhwb3J0IGludGVyZmFjZSBJbWFnZUNyb3BwZWRFdmVudCB7XG4gICAgYmFzZTY0Pzogc3RyaW5nIHwgbnVsbDtcbiAgICBmaWxlPzogQmxvYiB8IG51bGw7XG4gICAgd2lkdGg6IG51bWJlcjtcbiAgICBoZWlnaHQ6IG51bWJlcjtcbiAgICBjcm9wcGVyUG9zaXRpb246IENyb3BwZXJQb3NpdGlvbj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G9zaXRpb247XG4gICAgb2Zmc2V0SW1hZ2VQb3NpdGlvbj86IENyb3BwZXJQb3NpdGlvbjtcbiAgICB0cmFuc2Zvcm06IFRyYW5zZm9ybWF0aW9ucztcbn1cbiJdfQ== |
@@ -5,2 +5,2 @@ /** | ||
*/ | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbImxpYi9pbnRlcmZhY2VzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBDcm9wcGVyUG9zaXRpb24gfSBmcm9tICcuL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlJztcbmV4cG9ydCB7IERpbWVuc2lvbnMgfSBmcm9tICcuL2RpbWVuc2lvbnMuaW50ZXJmYWNlJztcbmV4cG9ydCB7IEltYWdlQ3JvcHBlZEV2ZW50IH0gZnJvbSAnLi9pbWFnZS1jcm9wcGVkLWV2ZW50LmludGVyZmFjZSc7XG5leHBvcnQgeyBNb3ZlU3RhcnQgfSBmcm9tICcuL21vdmUtc3RhcnQuaW50ZXJmYWNlJztcbmV4cG9ydCB7IFRyYW5zZm9ybWF0aW9ucyB9IGZyb20gJy4vdHJhbnNmb3JtYXRpb25zLmludGVyZmFjZXMnO1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZ3gtaW1hZ2UtY3JvcHBlci8iLCJzb3VyY2VzIjpbImxpYi9pbnRlcmZhY2VzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgeyBDcm9wcGVyUG9zaXRpb24gfSBmcm9tICcuL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlJztcbmV4cG9ydCB7IERpbWVuc2lvbnMgfSBmcm9tICcuL2RpbWVuc2lvbnMuaW50ZXJmYWNlJztcbmV4cG9ydCB7IEltYWdlQ3JvcHBlZEV2ZW50IH0gZnJvbSAnLi9pbWFnZS1jcm9wcGVkLWV2ZW50LmludGVyZmFjZSc7XG5leHBvcnQgeyBNb3ZlU3RhcnQgfSBmcm9tICcuL21vdmUtc3RhcnQuaW50ZXJmYWNlJztcbmV4cG9ydCB7IFRyYW5zZm9ybWF0aW9ucyB9IGZyb20gJy4vdHJhbnNmb3JtYXRpb25zLmludGVyZmFjZSc7XG4iXX0= |
@@ -14,12 +14,11 @@ /** | ||
switch (exifRotationOrBase64Image) { | ||
case 1: return { rotation: 0, flipH: false, flipV: false }; | ||
case 2: return { rotation: 0, flipH: true, flipV: false }; | ||
case 3: return { rotation: 2, flipH: false, flipV: false }; | ||
case 4: return { rotation: 2, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: false, flipV: false }; | ||
case 6: return { rotation: 1, flipH: true, flipV: false }; | ||
case 7: return { rotation: 3, flipH: false, flipV: false }; | ||
case 8: return { rotation: 3, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: true, flipV: false }; | ||
case 6: return { rotation: 1, flipH: false, flipV: false }; | ||
case 7: return { rotation: 3, flipH: true, flipV: false }; | ||
case 8: return { rotation: 3, flipH: false, flipV: false }; | ||
default: return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
@@ -88,2 +87,2 @@ /** | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhpZi51dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1pbWFnZS1jcm9wcGVyLyIsInNvdXJjZXMiOlsibGliL3V0aWxzL2V4aWYudXRpbHMudHMiXSwibmFtZXMi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ICAgd2hpbGUgKG9mZnNldCA8IGxlbmd0aCkge1xuICAgICAgICBpZiAodmlldy5nZXRVaW50MTYob2Zmc2V0ICsgMiwgZmFsc2UpIDw9IDgpIHJldHVybiAtMTtcbiAgICAgICAgY29uc3QgbWFya2VyID0gdmlldy5nZXRVaW50MTYob2Zmc2V0LCBmYWxzZSk7XG4gICAgICAgIG9mZnNldCArPSAyO1xuICAgICAgICBpZiAobWFya2VyID09IDB4RkZFMSkge1xuICAgICAgICAgICAgaWYgKHZpZXcuZ2V0VWludDMyKG9mZnNldCArPSAyLCBmYWxzZSkgIT0gMHg0NTc4Njk2Nikge1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgbGl0dGxlID0gdmlldy5nZXRVaW50MTYob2Zmc2V0ICs9IDYsIGZhbHNlKSA9PSAweDQ5NDk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gdmlldy5nZXRVaW50MzIob2Zmc2V0ICsgNCwgbGl0dGxlKTtcbiAgICAgICAgICAgIGNvbnN0IHRhZ3MgPSB2aWV3LmdldFVpbnQxNihvZmZzZXQsIGxpdHRsZSk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gMjtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGFnczsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHZpZXcuZ2V0VWludDE2KG9mZnNldCArIChpICogMTIpLCBsaXR0bGUpID09IDB4MDExMikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmlldy5nZXRVaW50MTYob2Zmc2V0ICsgKGkgKiAxMikgKyA4LCBsaXR0bGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICgobWFya2VyICYgMHhGRjAwKSAhPSAweEZGMDApIHtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGV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XRpb24gfSBmcm9tICcuL2Nyb3BwZXItcG9zaXRpb24uaW50ZXJmYWNlJztcbmV4cG9ydCB7IERpbWVuc2lvbnMgfSBmcm9tICcuL2RpbWVuc2lvbnMuaW50ZXJmYWNlJztcbmV4cG9ydCB7IEltYWdlQ3JvcHBlZEV2ZW50IH0gZnJvbSAnLi9pbWFnZS1jcm9wcGVkLWV2ZW50LmludGVyZmFjZSc7XG5leHBvcnQgeyBNb3ZlU3RhcnQgfSBmcm9tICcuL21vdmUtc3RhcnQuaW50ZXJmYWNlJztcbmV4cG9ydCB7IFRyYW5zZm9ybWF0aW9ucyB9IGZyb20gJy4vdHJhbnNmb3JtYXRpb25zLmludGVyZmFjZSc7XG4iXX0= |
@@ -14,12 +14,11 @@ /** | ||
switch (exifRotationOrBase64Image) { | ||
case 1: return { rotation: 0, flipH: false, flipV: false }; | ||
case 2: return { rotation: 0, flipH: true, flipV: false }; | ||
case 3: return { rotation: 2, flipH: false, flipV: false }; | ||
case 4: return { rotation: 2, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: false, flipV: false }; | ||
case 6: return { rotation: 1, flipH: true, flipV: false }; | ||
case 7: return { rotation: 3, flipH: false, flipV: false }; | ||
case 8: return { rotation: 3, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: true, flipV: false }; | ||
case 6: return { rotation: 1, flipH: false, flipV: false }; | ||
case 7: return { rotation: 3, flipH: true, flipV: false }; | ||
case 8: return { rotation: 3, flipH: false, flipV: false }; | ||
default: return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
@@ -88,2 +87,2 @@ /** | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhpZi51dGlscy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL25neC1pbWFnZS1jcm9wcGVyLyIsInNvdXJjZXMiOlsibGliL3V0aWxzL2V4aWYudXRpbHMudHM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ldCA9IDI7XG4gICAgd2hpbGUgKG9mZnNldCA8IGxlbmd0aCkge1xuICAgICAgICBpZiAodmlldy5nZXRVaW50MTYob2Zmc2V0ICsgMiwgZmFsc2UpIDw9IDgpIHJldHVybiAtMTtcbiAgICAgICAgY29uc3QgbWFya2VyID0gdmlldy5nZXRVaW50MTYob2Zmc2V0LCBmYWxzZSk7XG4gICAgICAgIG9mZnNldCArPSAyO1xuICAgICAgICBpZiAobWFya2VyID09IDB4RkZFMSkge1xuICAgICAgICAgICAgaWYgKHZpZXcuZ2V0VWludDMyKG9mZnNldCArPSAyLCBmYWxzZSkgIT0gMHg0NTc4Njk2Nikge1xuICAgICAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgbGl0dGxlID0gdmlldy5nZXRVaW50MTYob2Zmc2V0ICs9IDYsIGZhbHNlKSA9PSAweDQ5NDk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gdmlldy5nZXRVaW50MzIob2Zmc2V0ICsgNCwgbGl0dGxlKTtcbiAgICAgICAgICAgIGNvbnN0IHRhZ3MgPSB2aWV3LmdldFVpbnQxNihvZmZzZXQsIGxpdHRsZSk7XG4gICAgICAgICAgICBvZmZzZXQgKz0gMjtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGFnczsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHZpZXcuZ2V0VWludDE2KG9mZnNldCArIChpICogMTIpLCBsaXR0bGUpID09IDB4MDExMikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmlldy5nZXRVaW50MTYob2Zmc2V0ICsgKGkgKiAxMikgKyA4LCBsaXR0bGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICgobWFya2VyICYgMHhGRjAwKSAhPSAweEZGMDApIHtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9X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XMgPSBuZXcgVWludDhBcnJheShsZW4pO1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuOyBpKyspIHtcbiAgICAgICAgYnl0ZXNbaV0gPSBiaW5hcnlTdHJpbmcuY2hhckNvZGVBdChpKTtcbiAgICB9XG4gICAgcmV0dXJuIGJ5dGVzLmJ1ZmZlcjtcbn1cbiJdfQ== |
@@ -18,12 +18,11 @@ import { EventEmitter, Component, ChangeDetectionStrategy, ChangeDetectorRef, NgZone, ViewChild, Input, HostBinding, Output, HostListener, NgModule } from '@angular/core'; | ||
switch (exifRotationOrBase64Image) { | ||
case 1: return { rotation: 0, flipH: false, flipV: false }; | ||
case 2: return { rotation: 0, flipH: true, flipV: false }; | ||
case 3: return { rotation: 2, flipH: false, flipV: false }; | ||
case 4: return { rotation: 2, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: false, flipV: false }; | ||
case 6: return { rotation: 1, flipH: true, flipV: false }; | ||
case 7: return { rotation: 3, flipH: false, flipV: false }; | ||
case 8: return { rotation: 3, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: true, flipV: false }; | ||
case 6: return { rotation: 1, flipH: false, flipV: false }; | ||
case 7: return { rotation: 3, flipH: true, flipV: false }; | ||
case 8: return { rotation: 3, flipH: false, flipV: false }; | ||
default: return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
@@ -30,0 +29,0 @@ /** |
@@ -19,12 +19,11 @@ import { EventEmitter, Component, ChangeDetectionStrategy, ChangeDetectorRef, NgZone, ViewChild, Input, HostBinding, Output, HostListener, NgModule } from '@angular/core'; | ||
switch (exifRotationOrBase64Image) { | ||
case 1: return { rotation: 0, flipH: false, flipV: false }; | ||
case 2: return { rotation: 0, flipH: true, flipV: false }; | ||
case 3: return { rotation: 2, flipH: false, flipV: false }; | ||
case 4: return { rotation: 2, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: false, flipV: false }; | ||
case 6: return { rotation: 1, flipH: true, flipV: false }; | ||
case 7: return { rotation: 3, flipH: false, flipV: false }; | ||
case 8: return { rotation: 3, flipH: true, flipV: false }; | ||
case 5: return { rotation: 1, flipH: true, flipV: false }; | ||
case 6: return { rotation: 1, flipH: false, flipV: false }; | ||
case 7: return { rotation: 3, flipH: true, flipV: false }; | ||
case 8: return { rotation: 3, flipH: false, flipV: false }; | ||
default: return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
return { rotation: 0, flipH: false, flipV: false }; | ||
} | ||
@@ -31,0 +30,0 @@ /** |
@@ -1,3 +0,3 @@ | ||
import { CropperPosition } from "./cropper-position.interface"; | ||
import { Transformations } from './transformations.interfaces'; | ||
import { CropperPosition } from './cropper-position.interface'; | ||
import { Transformations } from './transformations.interface'; | ||
export interface ImageCroppedEvent { | ||
@@ -4,0 +4,0 @@ base64?: string | null; |
@@ -5,2 +5,2 @@ export { CropperPosition } from './cropper-position.interface'; | ||
export { MoveStart } from './move-start.interface'; | ||
export { Transformations } from './transformations.interfaces'; | ||
export { Transformations } from './transformations.interface'; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"exports":[{"export":[{"name":"CropperPosition","as":"CropperPosition"}],"from":"./lib/cropper-position.interface"},{"export":[{"name":"Dimensions","as":"Dimensions"}],"from":"./lib/dimensions.interface"},{"export":[{"name":"ImageCroppedEvent","as":"ImageCroppedEvent"}],"from":"./lib/image-cropped-event.interface"},{"export":[{"name":"MoveStart","as":"MoveStart"}],"from":"./lib/move-start.interface"},{"export":[{"name":"Transformations","as":"Transformations"}],"from":"./lib/transformations.interfaces"}],"metadata":{"ImageCropperModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","name":"ImageCropperComponent"}],"exports":[{"__symbolic":"reference","name":"ImageCropperComponent"}]}]}],"members":{}},"OutputType":{"__symbolic":"interface"},"ImageCropperComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"image-cropper","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":15,"character":21},"member":"OnPush"},"template":"<div [style.background]=\"imageVisible && backgroundColor\">\n <img\n #sourceImage\n class=\"source-image\"\n [src]=\"safeImgDataUrl\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n (load)=\"imageLoadedInView()\"\n />\n <div class=\"cropper\"\n *ngIf=\"imageVisible\"\n [class.rounded]=\"roundCropper\"\n [style.top.px]=\"cropper.y1\"\n [style.left.px]=\"cropper.x1\"\n [style.width.px]=\"cropper.x2 - cropper.x1\"\n [style.height.px]=\"cropper.y2 - cropper.y1\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n >\n <div\n (mousedown)=\"startMove($event, 'move')\"\n (touchstart)=\"startMove($event, 'move')\"\n class=\"move\"\n > </div>\n <span\n class=\"resize topleft\"\n (mousedown)=\"startMove($event, 'resize', 'topleft')\"\n (touchstart)=\"startMove($event, 'resize', 'topleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize top\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize topright\"\n (mousedown)=\"startMove($event, 'resize', 'topright')\"\n (touchstart)=\"startMove($event, 'resize', 'topright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize right\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomright\"\n (mousedown)=\"startMove($event, 'resize', 'bottomright')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottom\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomleft\"\n (mousedown)=\"startMove($event, 'resize', 'bottomleft')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize left\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize-bar top\"\n (mousedown)=\"startMove($event, 'resize', 'top')\"\n (touchstart)=\"startMove($event, 'resize', 'top')\"\n ></span>\n <span\n class=\"resize-bar right\"\n (mousedown)=\"startMove($event, 'resize', 'right')\"\n (touchstart)=\"startMove($event, 'resize', 'right')\"\n ></span>\n <span\n class=\"resize-bar bottom\"\n (mousedown)=\"startMove($event, 'resize', 'bottom')\"\n (touchstart)=\"startMove($event, 'resize', 'bottom')\"\n ></span>\n <span\n class=\"resize-bar left\"\n (mousedown)=\"startMove($event, 'resize', 'left')\"\n (touchstart)=\"startMove($event, 'resize', 'left')\"\n ></span>\n </div>\n</div>\n","styles":[":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:\"\";top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}"]}]}],"members":{"sourceImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":35,"character":5},"arguments":["sourceImage",{"static":true}]}]}],"imageChangedEvent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":5}}]}],"imageBase64":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":5}}]}],"imageFile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":51,"character":5}}]}],"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"outputType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":60,"character":5}}]}],"maintainAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":5}}]}],"aspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":62,"character":5}}]}],"resizeToWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":63,"character":5}}]}],"resizeToHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"cropperMinWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"cropperMinHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":5}}]}],"roundCropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":5}}]}],"onlyScaleDown":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"imageQuality":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"autoCrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":5}}]}],"backgroundColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"containWithinAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5}}]}],"cropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":5}}]}],"alignImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":79,"character":5},"arguments":["style.text-align"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":80,"character":5}}]}],"imageCropped":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":83,"character":5}}]}],"startCropImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":84,"character":5}}]}],"imageLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":85,"character":5}}]}],"cropperReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":86,"character":5}}]}],"loadImageFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":87,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":89,"character":35},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":90,"character":28},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":91,"character":30}]}],"ngOnChanges":[{"__symbolic":"method"}],"initCropper":[{"__symbolic":"method"}],"loadImageFile":[{"__symbolic":"method"}],"isValidImageType":[{"__symbolic":"method"}],"checkExifAndLoadBase64Image":[{"__symbolic":"method"}],"checkRotation":[{"__symbolic":"method"}],"getTransformedSize":[{"__symbolic":"method"}],"transformImageBase64":[{"__symbolic":"method"}],"setTransformedImage":[{"__symbolic":"method"}],"transformOriginalImage":[{"__symbolic":"method"}],"imageLoadedInView":[{"__symbolic":"method"}],"checkImageMaxSizeRecursively":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":298,"character":5},"arguments":["window:resize"]}]}],"rotateLeft":[{"__symbolic":"method"}],"rotateRight":[{"__symbolic":"method"}],"flipHorizontal":[{"__symbolic":"method"}],"flipVertical":[{"__symbolic":"method"}],"resetImage":[{"__symbolic":"method"}],"resizeCropperPosition":[{"__symbolic":"method"}],"resetCropperPosition":[{"__symbolic":"method"}],"startMove":[{"__symbolic":"method"}],"moveImg":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":375,"character":5},"arguments":["document:mousemove",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":376,"character":5},"arguments":["document:touchmove",["$event"]]}]}],"setMaxSize":[{"__symbolic":"method"}],"setCropperScaledMinSize":[{"__symbolic":"method"}],"setCropperScaledMinWidth":[{"__symbolic":"method"}],"setCropperScaledMinHeight":[{"__symbolic":"method"}],"checkCropperPosition":[{"__symbolic":"method"}],"moveStop":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":446,"character":5},"arguments":["document:mouseup"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":447,"character":5},"arguments":["document:touchend"]}]}],"move":[{"__symbolic":"method"}],"resize":[{"__symbolic":"method"}],"checkAspectRatio":[{"__symbolic":"method"}],"doAutoCrop":[{"__symbolic":"method"}],"crop":[{"__symbolic":"method"}],"getImagePosition":[{"__symbolic":"method"}],"getOffsetImagePosition":[{"__symbolic":"method"}],"cropToOutputType":[{"__symbolic":"method"}],"cropToBase64":[{"__symbolic":"method"}],"cropToFile":[{"__symbolic":"method"}],"getQuality":[{"__symbolic":"method"}],"getResizeRatio":[{"__symbolic":"method"}],"getClientX":[{"__symbolic":"method"}],"getClientY":[{"__symbolic":"method"}]}}},"origins":{"ImageCropperModule":"./lib/image-cropper.module","OutputType":"./lib/component/image-cropper.component","ImageCropperComponent":"./lib/component/image-cropper.component"},"importAs":"ngx-image-cropper"} | ||
{"__symbolic":"module","version":4,"exports":[{"export":[{"name":"CropperPosition","as":"CropperPosition"}],"from":"./lib/cropper-position.interface"},{"export":[{"name":"Dimensions","as":"Dimensions"}],"from":"./lib/dimensions.interface"},{"export":[{"name":"ImageCroppedEvent","as":"ImageCroppedEvent"}],"from":"./lib/image-cropped-event.interface"},{"export":[{"name":"MoveStart","as":"MoveStart"}],"from":"./lib/move-start.interface"},{"export":[{"name":"Transformations","as":"Transformations"}],"from":"./lib/transformations.interface"}],"metadata":{"ImageCropperModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":4,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":6,"character":8}],"declarations":[{"__symbolic":"reference","name":"ImageCropperComponent"}],"exports":[{"__symbolic":"reference","name":"ImageCropperComponent"}]}]}],"members":{}},"OutputType":{"__symbolic":"interface"},"ImageCropperComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":11,"character":1},"arguments":[{"selector":"image-cropper","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":15,"character":21},"member":"OnPush"},"template":"<div [style.background]=\"imageVisible && backgroundColor\">\n <img\n #sourceImage\n class=\"source-image\"\n [src]=\"safeImgDataUrl\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n (load)=\"imageLoadedInView()\"\n />\n <div class=\"cropper\"\n *ngIf=\"imageVisible\"\n [class.rounded]=\"roundCropper\"\n [style.top.px]=\"cropper.y1\"\n [style.left.px]=\"cropper.x1\"\n [style.width.px]=\"cropper.x2 - cropper.x1\"\n [style.height.px]=\"cropper.y2 - cropper.y1\"\n [style.margin-left]=\"alignImage === 'center' ? marginLeft : null\"\n [style.visibility]=\"imageVisible ? 'visible' : 'hidden'\"\n >\n <div\n (mousedown)=\"startMove($event, 'move')\"\n (touchstart)=\"startMove($event, 'move')\"\n class=\"move\"\n > </div>\n <span\n class=\"resize topleft\"\n (mousedown)=\"startMove($event, 'resize', 'topleft')\"\n (touchstart)=\"startMove($event, 'resize', 'topleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize top\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize topright\"\n (mousedown)=\"startMove($event, 'resize', 'topright')\"\n (touchstart)=\"startMove($event, 'resize', 'topright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize right\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomright\"\n (mousedown)=\"startMove($event, 'resize', 'bottomright')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomright')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottom\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize bottomleft\"\n (mousedown)=\"startMove($event, 'resize', 'bottomleft')\"\n (touchstart)=\"startMove($event, 'resize', 'bottomleft')\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize left\"\n ><span class=\"square\"></span></span>\n <span\n class=\"resize-bar top\"\n (mousedown)=\"startMove($event, 'resize', 'top')\"\n (touchstart)=\"startMove($event, 'resize', 'top')\"\n ></span>\n <span\n class=\"resize-bar right\"\n (mousedown)=\"startMove($event, 'resize', 'right')\"\n (touchstart)=\"startMove($event, 'resize', 'right')\"\n ></span>\n <span\n class=\"resize-bar bottom\"\n (mousedown)=\"startMove($event, 'resize', 'bottom')\"\n (touchstart)=\"startMove($event, 'resize', 'bottom')\"\n ></span>\n <span\n class=\"resize-bar left\"\n (mousedown)=\"startMove($event, 'resize', 'left')\"\n (touchstart)=\"startMove($event, 'resize', 'left')\"\n ></span>\n </div>\n</div>\n","styles":[":host{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host>div{position:relative;width:100%}:host>div img.source-image{max-width:100%;max-height:100%}:host .cropper{position:absolute;display:flex;color:#53535c;background:0 0;touch-action:none;outline:rgba(255,255,255,.3) solid 100vw}:host .cropper:after{position:absolute;content:\"\";top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}:host .cropper .move{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}:host .cropper .resize{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}:host .cropper .resize .square{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}:host .cropper .resize.topleft{top:-12px;left:-12px;cursor:nwse-resize}:host .cropper .resize.top{top:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.topright{top:-12px;right:-12px;cursor:nesw-resize}:host .cropper .resize.right{top:calc(50% - 12px);right:-12px;cursor:ew-resize}:host .cropper .resize.bottomright{bottom:-12px;right:-12px;cursor:nwse-resize}:host .cropper .resize.bottom{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}:host .cropper .resize.bottomleft{bottom:-12px;left:-12px;cursor:nesw-resize}:host .cropper .resize.left{top:calc(50% - 12px);left:-12px;cursor:ew-resize}:host .cropper .resize-bar{position:absolute;z-index:1}:host .cropper .resize-bar.top{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.right{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper .resize-bar.bottom{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}:host .cropper .resize-bar.left{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}:host .cropper.rounded{outline-color:transparent}:host .cropper.rounded:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3)}@media (orientation:portrait){:host .cropper{outline-width:100vh}:host .cropper.rounded:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3)}}:host .cropper.rounded .move{border-radius:100%}"]}]}],"members":{"sourceImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":35,"character":5},"arguments":["sourceImage",{"static":true}]}]}],"imageChangedEvent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":5}}]}],"imageBase64":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":5}}]}],"imageFile":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":51,"character":5}}]}],"format":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":5}}]}],"outputType":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":60,"character":5}}]}],"maintainAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":61,"character":5}}]}],"aspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":62,"character":5}}]}],"resizeToWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":63,"character":5}}]}],"resizeToHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":5}}]}],"cropperMinWidth":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":65,"character":5}}]}],"cropperMinHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":5}}]}],"roundCropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":67,"character":5}}]}],"onlyScaleDown":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":5}}]}],"imageQuality":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":69,"character":5}}]}],"autoCrop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":5}}]}],"backgroundColor":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":71,"character":5}}]}],"containWithinAspectRatio":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":72,"character":5}}]}],"cropper":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":73,"character":5}}]}],"alignImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":79,"character":5},"arguments":["style.text-align"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":80,"character":5}}]}],"imageCropped":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":83,"character":5}}]}],"startCropImage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":84,"character":5}}]}],"imageLoaded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":85,"character":5}}]}],"cropperReady":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":86,"character":5}}]}],"loadImageFailed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":87,"character":5}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/platform-browser","name":"DomSanitizer","line":89,"character":35},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":90,"character":28},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":91,"character":30}]}],"ngOnChanges":[{"__symbolic":"method"}],"initCropper":[{"__symbolic":"method"}],"loadImageFile":[{"__symbolic":"method"}],"isValidImageType":[{"__symbolic":"method"}],"checkExifAndLoadBase64Image":[{"__symbolic":"method"}],"checkRotation":[{"__symbolic":"method"}],"getTransformedSize":[{"__symbolic":"method"}],"transformImageBase64":[{"__symbolic":"method"}],"setTransformedImage":[{"__symbolic":"method"}],"transformOriginalImage":[{"__symbolic":"method"}],"imageLoadedInView":[{"__symbolic":"method"}],"checkImageMaxSizeRecursively":[{"__symbolic":"method"}],"onResize":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":298,"character":5},"arguments":["window:resize"]}]}],"rotateLeft":[{"__symbolic":"method"}],"rotateRight":[{"__symbolic":"method"}],"flipHorizontal":[{"__symbolic":"method"}],"flipVertical":[{"__symbolic":"method"}],"resetImage":[{"__symbolic":"method"}],"resizeCropperPosition":[{"__symbolic":"method"}],"resetCropperPosition":[{"__symbolic":"method"}],"startMove":[{"__symbolic":"method"}],"moveImg":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":375,"character":5},"arguments":["document:mousemove",["$event"]]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":376,"character":5},"arguments":["document:touchmove",["$event"]]}]}],"setMaxSize":[{"__symbolic":"method"}],"setCropperScaledMinSize":[{"__symbolic":"method"}],"setCropperScaledMinWidth":[{"__symbolic":"method"}],"setCropperScaledMinHeight":[{"__symbolic":"method"}],"checkCropperPosition":[{"__symbolic":"method"}],"moveStop":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":446,"character":5},"arguments":["document:mouseup"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":447,"character":5},"arguments":["document:touchend"]}]}],"move":[{"__symbolic":"method"}],"resize":[{"__symbolic":"method"}],"checkAspectRatio":[{"__symbolic":"method"}],"doAutoCrop":[{"__symbolic":"method"}],"crop":[{"__symbolic":"method"}],"getImagePosition":[{"__symbolic":"method"}],"getOffsetImagePosition":[{"__symbolic":"method"}],"cropToOutputType":[{"__symbolic":"method"}],"cropToBase64":[{"__symbolic":"method"}],"cropToFile":[{"__symbolic":"method"}],"getQuality":[{"__symbolic":"method"}],"getResizeRatio":[{"__symbolic":"method"}],"getClientX":[{"__symbolic":"method"}],"getClientY":[{"__symbolic":"method"}]}}},"origins":{"ImageCropperModule":"./lib/image-cropper.module","OutputType":"./lib/component/image-cropper.component","ImageCropperComponent":"./lib/component/image-cropper.component"},"importAs":"ngx-image-cropper"} |
{ | ||
"name": "ngx-image-cropper", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "An image cropper for Angular", | ||
@@ -5,0 +5,0 @@ "author": "Martijn Willekens", |
@@ -125,2 +125,3 @@ # Image cropper for Angular | ||
| `flipVertical` | void | Flips the image vertically | | ||
| `resetImage` | void | Reset the image to the original | | ||
| `crop` | ImageCroppedEvent (when `outputType` is `base64`) or Promise<ImageCroppedEvent> (when `outputType` is `file` or `both`)) | Crops the source image to the current cropper position. Accepts an output type as an argument, default is the one given in the `outputType` input (`base64`, `file` or `both`). Be sure to set `autoCrop` to `false` if you only wish to use this function directly. | | ||
@@ -127,0 +128,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
181
868992
7965