{"version":3,"file":"ngx-image-cropper.mjs","sources":["../../../projects/ngx-image-cropper/src/lib/interfaces/cropper.settings.ts","../../../projects/ngx-image-cropper/src/lib/interfaces/move-start.interface.ts","../../../projects/ngx-image-cropper/src/lib/utils/keyboard.utils.ts","../../../projects/ngx-image-cropper/src/lib/utils/resize.utils.ts","../../../projects/ngx-image-cropper/src/lib/utils/percentage.utils.ts","../../../projects/ngx-image-cropper/src/lib/services/crop.service.ts","../../../projects/ngx-image-cropper/src/lib/services/cropper-position.service.ts","../../../projects/ngx-image-cropper/src/lib/utils/exif.utils.ts","../../../projects/ngx-image-cropper/src/lib/services/load-image.service.ts","../../../projects/ngx-image-cropper/src/lib/component/image-cropper.component.ts","../../../projects/ngx-image-cropper/src/lib/component/image-cropper.component.html","../../../projects/ngx-image-cropper/src/lib/image-cropper.module.ts","../../../projects/ngx-image-cropper/src/lib/utils/blob.utils.ts","../../../projects/ngx-image-cropper/src/ngx-image-cropper.ts"],"sourcesContent":["import { CropperOptions, OutputFormat, OutputType } from './cropper-options.interface';\nimport { ImageTransform } from './image-transform.interface';\nimport { SimpleChanges } from '@angular/core';\n\nexport class CropperSettings {\n\n // From options\n format: OutputFormat = 'png';\n output: OutputType = 'blob';\n maintainAspectRatio = true;\n transform: ImageTransform = {};\n aspectRatio = 1;\n resetCropOnAspectRatioChange = true;\n resizeToWidth = 0;\n resizeToHeight = 0;\n cropperMinWidth = 0;\n cropperMinHeight = 0;\n cropperMaxHeight = 0;\n cropperMaxWidth = 0;\n cropperStaticWidth = 0;\n cropperStaticHeight = 0;\n canvasRotation = 0;\n initialStepSize = 3;\n roundCropper = false;\n onlyScaleDown = false;\n imageQuality = 92;\n autoCrop = true;\n backgroundColor: string | null = null;\n containWithinAspectRatio = false;\n hideResizeSquares = false;\n alignImage: 'left' | 'center' = 'center';\n cropperFrameAriaLabel = 'Crop photo';\n\n // Internal\n cropperScaledMinWidth = 20;\n cropperScaledMinHeight = 20;\n cropperScaledMaxWidth = 20;\n cropperScaledMaxHeight = 20;\n stepSize = this.initialStepSize;\n\n setOptions(options: Partial): void {\n Object.keys(options)\n .filter((k) => k in this)\n .forEach((k) => (this as any)[k] = (options as any)[k]);\n this.validateOptions();\n }\n\n setOptionsFromChanges(changes: SimpleChanges): void {\n Object.keys(changes)\n .filter((k) => k in this)\n .forEach((k) => (this as any)[k] = changes[k].currentValue);\n this.validateOptions();\n }\n\n private validateOptions(): void {\n if (this.maintainAspectRatio && !this.aspectRatio) {\n throw new Error('`aspectRatio` should > 0 when `maintainAspectRatio` is enabled');\n }\n }\n}\n","import { ImageTransform } from './image-transform.interface';\n\nexport interface MoveStart {\n active: boolean;\n type: MoveTypes | null;\n position: string | null;\n transform?: ImageTransform;\n x1: number;\n y1: number;\n x2: number;\n y2: number;\n clientX: number;\n clientY: number;\n}\n\nexport enum MoveTypes {\n Drag = 'drag',\n Move = 'move',\n Resize = 'resize',\n Pinch = 'pinch'\n}\n","export function getPositionForKey(key: string): string {\n switch (key) {\n case 'ArrowUp':\n return 'top';\n case 'ArrowRight':\n return 'right';\n case 'ArrowDown':\n return 'bottom';\n case 'ArrowLeft':\n default:\n return 'left';\n }\n}\n\nexport function getInvertedPositionForKey(key: string): string {\n switch (key) {\n case 'ArrowUp':\n return 'bottom';\n case 'ArrowRight':\n return 'left';\n case 'ArrowDown':\n return 'top';\n case 'ArrowLeft':\n default:\n return 'right';\n }\n}\n\nexport function getEventForKey(key: string, stepSize: number): any {\n switch (key) {\n case 'ArrowUp':\n return {clientX: 0, clientY: stepSize * -1};\n case 'ArrowRight':\n return {clientX: stepSize, clientY: 0};\n case 'ArrowDown':\n return {clientX: 0, clientY: stepSize};\n case 'ArrowLeft':\n default:\n return {clientX: stepSize * -1, clientY: 0};\n }\n}\n","/*\n * Hermite resize - fast image resize/resample using Hermite filter.\n * https://github.com/viliusle/Hermite-resize\n */\n\nexport function resizeCanvas(canvas: HTMLCanvasElement, width: number, height: number) {\n const width_source = canvas.width;\n const height_source = canvas.height;\n width = Math.round(width);\n height = Math.round(height);\n\n const ratio_w = width_source / width;\n const ratio_h = height_source / height;\n const ratio_w_half = Math.ceil(ratio_w / 2);\n const ratio_h_half = Math.ceil(ratio_h / 2);\n\n const ctx = canvas.getContext('2d');\n if (ctx) {\n const img = ctx.getImageData(0, 0, width_source, height_source);\n const img2 = ctx.createImageData(width, height);\n const data = img.data;\n const data2 = img2.data;\n\n for (let j = 0; j < height; j++) {\n for (let i = 0; i < width; i++) {\n const x2 = (i + j * width) * 4;\n const center_y = j * ratio_h;\n let weight = 0;\n let weights = 0;\n let weights_alpha = 0;\n let gx_r = 0;\n let gx_g = 0;\n let gx_b = 0;\n let gx_a = 0;\n\n const xx_start = Math.floor(i * ratio_w);\n const yy_start = Math.floor(j * ratio_h);\n let xx_stop = Math.ceil((i + 1) * ratio_w);\n let yy_stop = Math.ceil((j + 1) * ratio_h);\n xx_stop = Math.min(xx_stop, width_source);\n yy_stop = Math.min(yy_stop, height_source);\n\n for (let yy = yy_start; yy < yy_stop; yy++) {\n const dy = Math.abs(center_y - yy) / ratio_h_half;\n const center_x = i * ratio_w;\n const w0 = dy * dy; //pre-calc part of w\n for (let xx = xx_start; xx < xx_stop; xx++) {\n const dx = Math.abs(center_x - xx) / ratio_w_half;\n const w = Math.sqrt(w0 + dx * dx);\n if (w >= 1) {\n //pixel too far\n continue;\n }\n //hermite filter\n weight = 2 * w * w * w - 3 * w * w + 1;\n const pos_x = 4 * (xx + yy * width_source);\n //alpha\n gx_a += weight * data[pos_x + 3];\n weights_alpha += weight;\n //colors\n if (data[pos_x + 3] < 255)\n weight = weight * data[pos_x + 3] / 250;\n gx_r += weight * data[pos_x];\n gx_g += weight * data[pos_x + 1];\n gx_b += weight * data[pos_x + 2];\n weights += weight;\n }\n }\n data2[x2] = gx_r / weights;\n data2[x2 + 1] = gx_g / weights;\n data2[x2 + 2] = gx_b / weights;\n data2[x2 + 3] = gx_a / weights_alpha;\n }\n }\n\n\n canvas.width = width;\n canvas.height = height;\n\n //draw\n ctx.putImageData(img2, 0, 0);\n }\n}\n","export function percentage(percent: number, totalValue: number) {\n return (percent / 100) * totalValue;\n} ","import { ElementRef, Injectable } from '@angular/core';\nimport { CropperPosition, Dimensions, ImageCroppedEvent, LoadedImage } from '../interfaces';\nimport { CropperSettings } from '../interfaces/cropper.settings';\nimport { resizeCanvas } from '../utils/resize.utils';\nimport { percentage } from '../utils/percentage.utils';\nimport { OutputType } from '../interfaces/cropper-options.interface';\n\n@Injectable({providedIn: 'root'})\nexport class CropService {\n\n crop(loadedImage: LoadedImage, cropper: CropperPosition, settings: CropperSettings, output: 'blob', maxSize: Dimensions): Promise | null;\n crop(loadedImage: LoadedImage, cropper: CropperPosition, settings: CropperSettings, output: 'base64', maxSize: Dimensions): ImageCroppedEvent | null;\n crop(loadedImage: LoadedImage, cropper: CropperPosition, settings: CropperSettings, output: OutputType, maxSize: Dimensions): Promise | ImageCroppedEvent | null {\n const imagePosition = this.getImagePosition(loadedImage, cropper, settings, maxSize);\n const width = imagePosition.x2 - imagePosition.x1;\n const height = imagePosition.y2 - imagePosition.y1;\n const cropCanvas = document.createElement('canvas') as HTMLCanvasElement;\n cropCanvas.width = width;\n cropCanvas.height = height;\n\n const ctx = cropCanvas.getContext('2d');\n if (!ctx) {\n return null;\n }\n if (settings.backgroundColor != null) {\n ctx.fillStyle = settings.backgroundColor;\n ctx.fillRect(0, 0, width, height);\n }\n\n const scaleX = (settings.transform.scale || 1) * (settings.transform.flipH ? -1 : 1);\n const scaleY = (settings.transform.scale || 1) * (settings.transform.flipV ? -1 : 1);\n const {translateH, translateV} = this.getCanvasTranslate(loadedImage, settings, maxSize);\n\n const transformedImage = loadedImage.transformed;\n ctx.setTransform(scaleX, 0, 0, scaleY, transformedImage.size.width / 2 + translateH, transformedImage.size.height / 2 + translateV);\n ctx.translate(-imagePosition.x1 / scaleX, -imagePosition.y1 / scaleY);\n ctx.rotate((settings.transform.rotate || 0) * Math.PI / 180);\n\n ctx.drawImage(\n transformedImage.image,\n -transformedImage.size.width / 2,\n -transformedImage.size.height / 2\n );\n\n const result: ImageCroppedEvent = {\n width, height,\n imagePosition,\n cropperPosition: {...cropper}\n };\n if (settings.containWithinAspectRatio) {\n result.offsetImagePosition = this.getOffsetImagePosition(loadedImage, cropper, settings, maxSize);\n }\n const resizeRatio = this.getResizeRatio(width, height, settings);\n if (resizeRatio !== 1) {\n result.width = Math.round(width * resizeRatio);\n result.height = settings.maintainAspectRatio\n ? Math.round(result.width / settings.aspectRatio)\n : Math.round(height * resizeRatio);\n resizeCanvas(cropCanvas, result.width, result.height);\n }\n if (output === 'blob') {\n return this.cropToBlob(result, cropCanvas, settings);\n } else {\n result.base64 = cropCanvas.toDataURL('image/' + settings.format, this.getQuality(settings));\n return result;\n }\n }\n\n private async cropToBlob(output: ImageCroppedEvent, cropCanvas: HTMLCanvasElement, settings: CropperSettings): Promise {\n output.blob = await new Promise(resolve => cropCanvas.toBlob(resolve, 'image/' + settings.format, this.getQuality(settings)));\n if (output.blob) {\n output.objectUrl = URL.createObjectURL(output.blob);\n }\n return output;\n }\n\n private getCanvasTranslate(loadedImage: LoadedImage, settings: CropperSettings, maxSize: Dimensions): { translateH: number, translateV: number } {\n if (settings.transform.translateUnit === 'px') {\n const ratio = this.getRatio(loadedImage, maxSize);\n return {\n translateH: (settings.transform.translateH || 0) * ratio,\n translateV: (settings.transform.translateV || 0) * ratio\n };\n } else {\n return {\n translateH: settings.transform.translateH ? percentage(settings.transform.translateH, loadedImage.transformed.size.width) : 0,\n translateV: settings.transform.translateV ? percentage(settings.transform.translateV, loadedImage.transformed.size.height) : 0\n };\n }\n }\n\n private getRatio(loadedImage: LoadedImage, maxSize: Dimensions): number {\n return loadedImage.transformed.size.width / maxSize.width;\n }\n\n private getImagePosition(loadedImage: LoadedImage, cropper: CropperPosition, settings: CropperSettings, maxSize: Dimensions): CropperPosition {\n const ratio = this.getRatio(loadedImage, maxSize);\n const out: CropperPosition = {\n x1: Math.round(cropper.x1 * ratio),\n y1: Math.round(cropper.y1 * ratio),\n x2: Math.round(cropper.x2 * ratio),\n y2: Math.round(cropper.y2 * ratio)\n };\n\n if (!settings.containWithinAspectRatio) {\n out.x1 = Math.max(out.x1, 0);\n out.y1 = Math.max(out.y1, 0);\n out.x2 = Math.min(out.x2, loadedImage.transformed.size.width);\n out.y2 = Math.min(out.y2, loadedImage.transformed.size.height);\n }\n\n return out;\n }\n\n private getOffsetImagePosition(loadedImage: LoadedImage, cropper: CropperPosition, settings: CropperSettings, maxSize: Dimensions): CropperPosition {\n const canvasRotation = settings.canvasRotation + loadedImage.exifTransform.rotate;\n const ratio = this.getRatio(loadedImage, maxSize);\n let offsetX: number;\n let offsetY: number;\n\n if (canvasRotation % 2) {\n offsetX = (loadedImage.transformed.size.width - loadedImage.original.size.height) / 2;\n offsetY = (loadedImage.transformed.size.height - loadedImage.original.size.width) / 2;\n } else {\n offsetX = (loadedImage.transformed.size.width - loadedImage.original.size.width) / 2;\n offsetY = (loadedImage.transformed.size.height - loadedImage.original.size.height) / 2;\n }\n\n const out: CropperPosition = {\n x1: Math.round(cropper.x1 * ratio) - offsetX,\n y1: Math.round(cropper.y1 * ratio) - offsetY,\n x2: Math.round(cropper.x2 * ratio) - offsetX,\n y2: Math.round(cropper.y2 * ratio) - offsetY\n };\n\n if (!settings.containWithinAspectRatio) {\n out.x1 = Math.max(out.x1, 0);\n out.y1 = Math.max(out.y1, 0);\n out.x2 = Math.min(out.x2, loadedImage.transformed.size.width);\n out.y2 = Math.min(out.y2, loadedImage.transformed.size.height);\n }\n\n return out;\n }\n\n getResizeRatio(width: number, height: number, settings: CropperSettings): number {\n const ratioWidth = settings.resizeToWidth / width;\n const ratioHeight = settings.resizeToHeight / height;\n const ratios = new Array();\n\n if (settings.resizeToWidth > 0) {\n ratios.push(ratioWidth);\n }\n if (settings.resizeToHeight > 0) {\n ratios.push(ratioHeight);\n }\n\n const result = ratios.length === 0 ? 1 : Math.min(...ratios);\n\n if (result > 1 && !settings.onlyScaleDown) {\n return result;\n }\n return Math.min(result, 1);\n }\n\n getQuality(settings: CropperSettings): number {\n return Math.min(1, Math.max(0, settings.imageQuality / 100));\n }\n}\n","import { ElementRef, Injectable } from '@angular/core';\nimport { CropperPosition, Dimensions, MoveStart } from '../interfaces';\nimport { CropperSettings } from '../interfaces/cropper.settings';\n\n@Injectable({ providedIn: 'root' })\nexport class CropperPositionService {\n\n resetCropperPosition(sourceImage: ElementRef, cropperPosition: CropperPosition, settings: CropperSettings, maxSize: Dimensions): void {\n if (!sourceImage?.nativeElement) {\n return;\n }\n if (settings.cropperStaticHeight && settings.cropperStaticWidth) {\n cropperPosition.x1 = 0;\n cropperPosition.x2 = maxSize.width > settings.cropperStaticWidth ?\n settings.cropperStaticWidth : maxSize.width;\n cropperPosition.y1 = 0;\n cropperPosition.y2 = maxSize.height > settings.cropperStaticHeight ?\n settings.cropperStaticHeight : maxSize.height;\n } else {\n const cropperWidth = Math.min(settings.cropperScaledMaxWidth, maxSize.width);\n const cropperHeight = Math.min(settings.cropperScaledMaxHeight, maxSize.height);\n if (!settings.maintainAspectRatio) {\n cropperPosition.x1 = 0;\n cropperPosition.x2 = cropperWidth;\n cropperPosition.y1 = 0;\n cropperPosition.y2 = cropperHeight;\n } else if (maxSize.width / settings.aspectRatio < maxSize.height) {\n cropperPosition.x1 = 0;\n cropperPosition.x2 = cropperWidth;\n const cropperHeightWithAspectRatio = cropperWidth / settings.aspectRatio;\n cropperPosition.y1 = (maxSize.height - cropperHeightWithAspectRatio) / 2;\n cropperPosition.y2 = cropperPosition.y1 + cropperHeightWithAspectRatio;\n } else {\n cropperPosition.y1 = 0;\n cropperPosition.y2 = cropperHeight;\n const cropperWidthWithAspectRatio = cropperHeight * settings.aspectRatio;\n cropperPosition.x1 = (maxSize.width - cropperWidthWithAspectRatio) / 2;\n cropperPosition.x2 = cropperPosition.x1 + cropperWidthWithAspectRatio;\n }\n }\n }\n\n move(event: any, moveStart: MoveStart, cropperPosition: CropperPosition) {\n const diffX = this.getClientX(event) - moveStart.clientX;\n const diffY = this.getClientY(event) - moveStart.clientY;\n\n cropperPosition.x1 = moveStart.x1 + diffX;\n cropperPosition.y1 = moveStart.y1 + diffY;\n cropperPosition.x2 = moveStart.x2 + diffX;\n cropperPosition.y2 = moveStart.y2 + diffY;\n }\n\n resize(event: any, moveStart: MoveStart, cropperPosition: CropperPosition, maxSize: Dimensions, settings: CropperSettings): void {\n const moveX = this.getClientX(event) - moveStart.clientX;\n const moveY = this.getClientY(event) - moveStart.clientY;\n switch (moveStart.position) {\n case 'left':\n cropperPosition.x1 = Math.min(Math.max(moveStart.x1 + moveX, cropperPosition.x2 - settings.cropperScaledMaxWidth),\n cropperPosition.x2 - settings.cropperScaledMinWidth);\n break;\n case 'topleft':\n cropperPosition.x1 = Math.min(Math.max(moveStart.x1 + moveX, cropperPosition.x2 - settings.cropperScaledMaxWidth),\n cropperPosition.x2 - settings.cropperScaledMinWidth);\n cropperPosition.y1 = Math.min(Math.max(moveStart.y1 + moveY, cropperPosition.y2 - settings.cropperScaledMaxHeight),\n cropperPosition.y2 - settings.cropperScaledMinHeight);\n break;\n case 'top':\n cropperPosition.y1 = Math.min(Math.max(moveStart.y1 + moveY, cropperPosition.y2 - settings.cropperScaledMaxHeight),\n cropperPosition.y2 - settings.cropperScaledMinHeight);\n break;\n case 'topright':\n cropperPosition.x2 = Math.max(Math.min(moveStart.x2 + moveX, cropperPosition.x1 + settings.cropperScaledMaxWidth),\n cropperPosition.x1 + settings.cropperScaledMinWidth);\n cropperPosition.y1 = Math.min(Math.max(moveStart.y1 + moveY, cropperPosition.y2 - settings.cropperScaledMaxHeight),\n cropperPosition.y2 - settings.cropperScaledMinHeight);\n break;\n case 'right':\n cropperPosition.x2 = Math.max(Math.min(moveStart.x2 + moveX, cropperPosition.x1 + settings.cropperScaledMaxWidth),\n cropperPosition.x1 + settings.cropperScaledMinWidth);\n break;\n case 'bottomright':\n cropperPosition.x2 = Math.max(Math.min(moveStart.x2 + moveX, cropperPosition.x1 + settings.cropperScaledMaxWidth),\n cropperPosition.x1 + settings.cropperScaledMinWidth);\n cropperPosition.y2 = Math.max(Math.min(moveStart.y2 + moveY, cropperPosition.y1 + settings.cropperScaledMaxHeight),\n cropperPosition.y1 + settings.cropperScaledMinHeight);\n break;\n case 'bottom':\n cropperPosition.y2 = Math.max(Math.min(moveStart.y2 + moveY, cropperPosition.y1 + settings.cropperScaledMaxHeight),\n cropperPosition.y1 + settings.cropperScaledMinHeight);\n break;\n case 'bottomleft':\n cropperPosition.x1 = Math.min(Math.max(moveStart.x1 + moveX, cropperPosition.x2 - settings.cropperScaledMaxWidth),\n cropperPosition.x2 - settings.cropperScaledMinWidth);\n cropperPosition.y2 = Math.max(Math.min(moveStart.y2 + moveY, cropperPosition.y1 + settings.cropperScaledMaxHeight),\n cropperPosition.y1 + settings.cropperScaledMinHeight);\n break;\n case 'center':\n const scale = event.scale;\n const newWidth = Math.min(\n Math.max(settings.cropperScaledMinWidth, (Math.abs(moveStart.x2 - moveStart.x1)) * scale),\n settings.cropperScaledMaxWidth);\n const newHeight = Math.min(\n Math.max(settings.cropperScaledMinHeight, (Math.abs(moveStart.y2 - moveStart.y1)) * scale),\n settings.cropperScaledMaxHeight);\n cropperPosition.x1 = moveStart.clientX - newWidth / 2;\n cropperPosition.x2 = moveStart.clientX + newWidth / 2;\n cropperPosition.y1 = moveStart.clientY - newHeight / 2;\n cropperPosition.y2 = moveStart.clientY + newHeight / 2;\n if (cropperPosition.x1 < 0) {\n cropperPosition.x2 -= cropperPosition.x1;\n cropperPosition.x1 = 0;\n } else if (cropperPosition.x2 > maxSize.width) {\n cropperPosition.x1 -= (cropperPosition.x2 - maxSize.width);\n cropperPosition.x2 = maxSize.width;\n }\n if (cropperPosition.y1 < 0) {\n cropperPosition.y2 -= cropperPosition.y1;\n cropperPosition.y1 = 0;\n } else if (cropperPosition.y2 > maxSize.height) {\n cropperPosition.y1 -= (cropperPosition.y2 - maxSize.height);\n cropperPosition.y2 = maxSize.height;\n }\n break;\n }\n\n if (settings.maintainAspectRatio) {\n this.checkAspectRatio(moveStart.position!, cropperPosition, maxSize, settings);\n }\n }\n\n checkAspectRatio(position: string, cropperPosition: CropperPosition, maxSize: Dimensions, settings: CropperSettings): void {\n let overflowX = 0;\n let overflowY = 0;\n\n switch (position) {\n case 'top':\n cropperPosition.x2 = cropperPosition.x1 + (cropperPosition.y2 - cropperPosition.y1) * settings.aspectRatio;\n overflowX = Math.max(cropperPosition.x2 - maxSize.width, 0);\n overflowY = Math.max(0 - cropperPosition.y1, 0);\n if (overflowX > 0 || overflowY > 0) {\n cropperPosition.x2 -= (overflowY * settings.aspectRatio) > overflowX ? (overflowY * settings.aspectRatio) : overflowX;\n cropperPosition.y1 += (overflowY * settings.aspectRatio) > overflowX ? overflowY : overflowX / settings.aspectRatio;\n }\n break;\n case 'bottom':\n cropperPosition.x2 = cropperPosition.x1 + (cropperPosition.y2 - cropperPosition.y1) * settings.aspectRatio;\n overflowX = Math.max(cropperPosition.x2 - maxSize.width, 0);\n overflowY = Math.max(cropperPosition.y2 - maxSize.height, 0);\n if (overflowX > 0 || overflowY > 0) {\n cropperPosition.x2 -= (overflowY * settings.aspectRatio) > overflowX ? (overflowY * settings.aspectRatio) : overflowX;\n cropperPosition.y2 -= (overflowY * settings.aspectRatio) > overflowX ? overflowY : (overflowX / settings.aspectRatio);\n }\n break;\n case 'topleft':\n cropperPosition.y1 = cropperPosition.y2 - (cropperPosition.x2 - cropperPosition.x1) / settings.aspectRatio;\n overflowX = Math.max(0 - cropperPosition.x1, 0);\n overflowY = Math.max(0 - cropperPosition.y1, 0);\n if (overflowX > 0 || overflowY > 0) {\n cropperPosition.x1 += (overflowY * settings.aspectRatio) > overflowX ? (overflowY * settings.aspectRatio) : overflowX;\n cropperPosition.y1 += (overflowY * settings.aspectRatio) > overflowX ? overflowY : overflowX / settings.aspectRatio;\n }\n break;\n case 'topright':\n cropperPosition.y1 = cropperPosition.y2 - (cropperPosition.x2 - cropperPosition.x1) / settings.aspectRatio;\n overflowX = Math.max(cropperPosition.x2 - maxSize.width, 0);\n overflowY = Math.max(0 - cropperPosition.y1, 0);\n if (overflowX > 0 || overflowY > 0) {\n cropperPosition.x2 -= (overflowY * settings.aspectRatio) > overflowX ? (overflowY * settings.aspectRatio) : overflowX;\n cropperPosition.y1 += (overflowY * settings.aspectRatio) > overflowX ? overflowY : overflowX / settings.aspectRatio;\n }\n break;\n case 'right':\n case 'bottomright':\n cropperPosition.y2 = cropperPosition.y1 + (cropperPosition.x2 - cropperPosition.x1) / settings.aspectRatio;\n overflowX = Math.max(cropperPosition.x2 - maxSize.width, 0);\n overflowY = Math.max(cropperPosition.y2 - maxSize.height, 0);\n if (overflowX > 0 || overflowY > 0) {\n cropperPosition.x2 -= (overflowY * settings.aspectRatio) > overflowX ? (overflowY * settings.aspectRatio) : overflowX;\n cropperPosition.y2 -= (overflowY * settings.aspectRatio) > overflowX ? overflowY : overflowX / settings.aspectRatio;\n }\n break;\n case 'left':\n case 'bottomleft':\n cropperPosition.y2 = cropperPosition.y1 + (cropperPosition.x2 - cropperPosition.x1) / settings.aspectRatio;\n overflowX = Math.max(0 - cropperPosition.x1, 0);\n overflowY = Math.max(cropperPosition.y2 - maxSize.height, 0);\n if (overflowX > 0 || overflowY > 0) {\n cropperPosition.x1 += (overflowY * settings.aspectRatio) > overflowX ? (overflowY * settings.aspectRatio) : overflowX;\n cropperPosition.y2 -= (overflowY * settings.aspectRatio) > overflowX ? overflowY : overflowX / settings.aspectRatio;\n }\n break;\n case 'center':\n cropperPosition.x2 = cropperPosition.x1 + (cropperPosition.y2 - cropperPosition.y1) * settings.aspectRatio;\n cropperPosition.y2 = cropperPosition.y1 + (cropperPosition.x2 - cropperPosition.x1) / settings.aspectRatio;\n const overflowX1 = Math.max(0 - cropperPosition.x1, 0);\n const overflowX2 = Math.max(cropperPosition.x2 - maxSize.width, 0);\n const overflowY1 = Math.max(cropperPosition.y2 - maxSize.height, 0);\n const overflowY2 = Math.max(0 - cropperPosition.y1, 0);\n if (overflowX1 > 0 || overflowX2 > 0 || overflowY1 > 0 || overflowY2 > 0) {\n cropperPosition.x1 += (overflowY1 * settings.aspectRatio) > overflowX1 ? (overflowY1 * settings.aspectRatio) : overflowX1;\n cropperPosition.x2 -= (overflowY2 * settings.aspectRatio) > overflowX2 ? (overflowY2 * settings.aspectRatio) : overflowX2;\n cropperPosition.y1 += (overflowY2 * settings.aspectRatio) > overflowX2 ? overflowY2 : overflowX2 / settings.aspectRatio;\n cropperPosition.y2 -= (overflowY1 * settings.aspectRatio) > overflowX1 ? overflowY1 : overflowX1 / settings.aspectRatio;\n }\n break;\n }\n }\n\n getClientX(event: any): number {\n return event.touches?.[0].clientX || event.clientX || 0;\n }\n\n getClientY(event: any): number {\n return event.touches?.[0].clientY || event.clientY || 0;\n }\n}\n","import { ExifTransform } from '../interfaces/exif-transform.interface';\n\n// Black 2x1 JPEG, with the following meta information set:\n// - EXIF Orientation: 6 (Rotated 90° CCW)\n// Source: https://github.com/blueimp/JavaScript-Load-Image\nconst testAutoOrientationImageURL =\n 'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' +\n 'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' +\n 'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' +\n 'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/x' +\n 'ABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAA' +\n 'AAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==';\n\nexport function supportsAutomaticRotation(): Promise {\n return new Promise((resolve) => {\n const img = new Image();\n img.onload = () => {\n // Check if browser supports automatic image orientation:\n const supported = img.width === 1 && img.height === 2;\n resolve(supported);\n };\n img.src = testAutoOrientationImageURL;\n });\n}\n\nexport function getTransformationsFromExifData(exifRotationOrArrayBuffer: number | ArrayBufferLike): ExifTransform {\n if (typeof exifRotationOrArrayBuffer === 'object') {\n exifRotationOrArrayBuffer = getExifRotation(exifRotationOrArrayBuffer);\n }\n switch (exifRotationOrArrayBuffer) {\n case 2:\n return { rotate: 0, flip: true };\n case 3:\n return { rotate: 2, flip: false };\n case 4:\n return { rotate: 2, flip: true };\n case 5:\n return { rotate: 1, flip: true };\n case 6:\n return { rotate: 1, flip: false };\n case 7:\n return { rotate: 3, flip: true };\n case 8:\n return { rotate: 3, flip: false };\n default:\n return { rotate: 0, flip: false };\n }\n}\n\nfunction getExifRotation(arrayBuffer: ArrayBufferLike): number {\n const view = new DataView(arrayBuffer);\n if (view.getUint16(0, false) !== 0xFFD8) {\n return -2;\n }\n const length = view.byteLength;\n let offset = 2;\n while (offset < length) {\n if (view.getUint16(offset + 2, false) <= 8) return -1;\n const marker = view.getUint16(offset, false);\n offset += 2;\n if (marker == 0xFFE1) {\n if (view.getUint32(offset += 2, false) !== 0x45786966) {\n return -1;\n }\n\n const little = view.getUint16(offset += 6, false) == 0x4949;\n offset += view.getUint32(offset + 4, little);\n const tags = view.getUint16(offset, little);\n offset += 2;\n for (let i = 0; i < tags; i++) {\n if (view.getUint16(offset + (i * 12), little) == 0x0112) {\n return view.getUint16(offset + (i * 12) + 8, little);\n }\n }\n } else if ((marker & 0xFF00) !== 0xFF00) {\n break;\n } else {\n offset += view.getUint16(offset, false);\n }\n }\n return -1;\n}\n","import { Injectable } from '@angular/core';\nimport { Dimensions, LoadedImage } from '../interfaces';\nimport { CropperSettings } from '../interfaces/cropper.settings';\nimport { ExifTransform } from '../interfaces/exif-transform.interface';\nimport { getTransformationsFromExifData, supportsAutomaticRotation } from '../utils/exif.utils';\n\ninterface LoadImageArrayBuffer {\n originalImage: HTMLImageElement;\n originalArrayBuffer: ArrayBufferLike;\n originalObjectUrl: string;\n originalImageSize?: { width: number; height: number; } | null;\n}\n\n@Injectable({providedIn: 'root'})\nexport class LoadImageService {\n\n private autoRotateSupported: Promise = supportsAutomaticRotation();\n\n async loadImageFile(file: File, cropperSettings: CropperSettings): Promise {\n const arrayBuffer = await file.arrayBuffer();\n return await this.checkImageTypeAndLoadImageFromArrayBuffer(arrayBuffer, file.type, cropperSettings);\n }\n\n private checkImageTypeAndLoadImageFromArrayBuffer(arrayBuffer: ArrayBufferLike, imageType: string, cropperSettings: CropperSettings): Promise {\n if (!this.isValidImageType(imageType)) {\n return Promise.reject(new Error('Invalid image type'));\n }\n return this.loadImageFromArrayBuffer(arrayBuffer, cropperSettings, imageType);\n }\n\n private isValidImageType(type: string): boolean {\n return /image\\/(png|jpg|jpeg|bmp|gif|tiff|svg|webp|x-icon|vnd.microsoft.icon)/.test(type);\n }\n\n async loadImageFromURL(url: string, cropperSettings: CropperSettings): Promise {\n const res = await fetch(url);\n const blob = await res.blob();\n const buffer = await blob.arrayBuffer();\n return await this.loadImageFromArrayBuffer(buffer, cropperSettings, blob.type);\n }\n\n loadBase64Image(imageBase64: string, cropperSettings: CropperSettings): Promise {\n const arrayBuffer = this.base64ToArrayBuffer(imageBase64);\n return this.loadImageFromArrayBuffer(arrayBuffer, cropperSettings);\n }\n\n private base64ToArrayBuffer(imageBase64: string): ArrayBufferLike {\n imageBase64 = imageBase64.replace(/^data:([^;]+);base64,/gmi, '');\n const binaryString = atob(imageBase64);\n const len = binaryString.length;\n const bytes = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes.buffer;\n }\n\n private async loadImageFromArrayBuffer(arrayBuffer: ArrayBufferLike, cropperSettings: CropperSettings, imageType?: string): Promise {\n const res = await new Promise(async (resolve, reject) => {\n try {\n const blob = new Blob([arrayBuffer], imageType ? {type: imageType} : undefined);\n const objectUrl = URL.createObjectURL(blob);\n const originalImage = new Image();\n const isSvg = imageType === 'image/svg+xml';\n const originalImageSize = isSvg ? await this.getSvgImageSize(blob) : undefined;\n originalImage.onload = () => resolve({\n originalImage,\n originalImageSize,\n originalObjectUrl: objectUrl,\n originalArrayBuffer: arrayBuffer\n });\n originalImage.onerror = reject;\n originalImage.src = objectUrl;\n } catch (e) {\n reject(e);\n }\n });\n return await this.transformImageFromArrayBuffer(res, cropperSettings, res.originalImageSize != null);\n }\n\n private async getSvgImageSize(blob: Blob): Promise<{ width: number; height: number; } | null> {\n const parser = new DOMParser();\n const doc = parser.parseFromString(await blob.text(), 'image/svg+xml');\n const svgElement = doc.querySelector('svg');\n if (!svgElement) {\n throw Error('Failed to parse SVG image');\n }\n const widthAttr = svgElement.getAttribute('width');\n const heightAttr = svgElement.getAttribute('height');\n if (widthAttr && heightAttr) {\n return null;\n }\n const viewBoxAttr = svgElement.getAttribute('viewBox')\n || svgElement.getAttribute('viewbox');\n if (viewBoxAttr) {\n const viewBox = viewBoxAttr.split(' ');\n return {\n width: +viewBox[2],\n height: +viewBox[3]\n };\n }\n throw Error('Failed to load SVG image. SVG must have width + height or viewBox definition.');\n }\n\n private async transformImageFromArrayBuffer(res: LoadImageArrayBuffer, cropperSettings: CropperSettings, forceTransform = false): Promise {\n const autoRotate = await this.autoRotateSupported;\n const exifTransform = getTransformationsFromExifData(autoRotate ? -1 : res.originalArrayBuffer);\n if (!res.originalImage || !res.originalImage.complete) {\n return Promise.reject(new Error('No image loaded'));\n }\n const loadedImage = {\n original: {\n objectUrl: res.originalObjectUrl,\n image: res.originalImage,\n size: res.originalImageSize ?? {\n width: res.originalImage.naturalWidth,\n height: res.originalImage.naturalHeight\n }\n },\n exifTransform\n };\n return this.transformLoadedImage(loadedImage, cropperSettings, forceTransform);\n }\n\n async transformLoadedImage(loadedImage: Partial, cropperSettings: CropperSettings, forceTransform = false): Promise {\n const canvasRotation = cropperSettings.canvasRotation + loadedImage.exifTransform!.rotate;\n const originalSize = loadedImage.original!.size;\n if (!forceTransform && canvasRotation === 0 && !loadedImage.exifTransform!.flip && !cropperSettings.containWithinAspectRatio) {\n return {\n original: {\n objectUrl: loadedImage.original!.objectUrl,\n image: loadedImage.original!.image,\n size: {...originalSize}\n },\n transformed: {\n objectUrl: loadedImage.original!.objectUrl,\n image: loadedImage.original!.image,\n size: {...originalSize}\n },\n exifTransform: loadedImage.exifTransform!\n };\n }\n\n const transformedSize = this.getTransformedSize(originalSize, loadedImage.exifTransform!, cropperSettings);\n const canvas = document.createElement('canvas');\n canvas.width = transformedSize.width;\n canvas.height = transformedSize.height;\n const ctx = canvas.getContext('2d');\n ctx?.setTransform(\n loadedImage.exifTransform!.flip ? -1 : 1,\n 0,\n 0,\n 1,\n canvas.width / 2,\n canvas.height / 2\n );\n ctx?.rotate(Math.PI * (canvasRotation / 2));\n ctx?.drawImage(\n loadedImage.original!.image,\n -originalSize.width / 2,\n -originalSize.height / 2\n );\n const blob = await new Promise(resolve => canvas.toBlob(resolve, cropperSettings.format));\n if (!blob) {\n throw new Error('Failed to get Blob for transformed image.');\n }\n const objectUrl = URL.createObjectURL(blob);\n const transformedImage = await this.loadImageFromObjectUrl(objectUrl);\n return {\n original: {\n objectUrl: loadedImage.original!.objectUrl,\n image: loadedImage.original!.image,\n size: {...originalSize}\n },\n transformed: {\n objectUrl: objectUrl,\n image: transformedImage,\n size: {\n width: transformedImage.width,\n height: transformedImage.height\n }\n },\n exifTransform: loadedImage.exifTransform!\n };\n }\n\n private loadImageFromObjectUrl(objectUrl: string): Promise {\n return new Promise(((resolve, reject) => {\n const image = new Image();\n image.onload = () => resolve(image);\n image.onerror = reject;\n image.src = objectUrl;\n }));\n }\n\n private getTransformedSize(\n originalSize: { width: number, height: number },\n exifTransform: ExifTransform,\n cropperSettings: CropperSettings\n ): Dimensions {\n const canvasRotation = cropperSettings.canvasRotation + exifTransform.rotate;\n if (cropperSettings.containWithinAspectRatio) {\n if (canvasRotation % 2) {\n const minWidthToContain = originalSize.width * cropperSettings.aspectRatio;\n const minHeightToContain = originalSize.height / cropperSettings.aspectRatio;\n return {\n width: Math.max(originalSize.height, minWidthToContain),\n height: Math.max(originalSize.width, minHeightToContain)\n };\n } else {\n const minWidthToContain = originalSize.height * cropperSettings.aspectRatio;\n const minHeightToContain = originalSize.width / cropperSettings.aspectRatio;\n return {\n width: Math.max(originalSize.width, minWidthToContain),\n height: Math.max(originalSize.height, minHeightToContain)\n };\n }\n }\n\n if (canvasRotation % 2) {\n return {\n height: originalSize.width,\n width: originalSize.height\n };\n }\n return {\n width: originalSize.width,\n height: originalSize.height\n };\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Inject,\n Input,\n isDevMode,\n NgZone,\n OnChanges,\n OnInit,\n Optional,\n Output,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\nimport { DomSanitizer, HAMMER_LOADER, HammerLoader, SafeStyle, SafeUrl } from '@angular/platform-browser';\nimport { CropperPosition, Dimensions, ImageCroppedEvent, ImageTransform, LoadedImage, MoveStart } from '../interfaces';\nimport { OutputFormat, OutputType } from '../interfaces/cropper-options.interface';\nimport { CropperSettings } from '../interfaces/cropper.settings';\nimport { MoveTypes } from '../interfaces/move-start.interface';\nimport { CropService } from '../services/crop.service';\nimport { CropperPositionService } from '../services/cropper-position.service';\nimport { LoadImageService } from '../services/load-image.service';\nimport { HammerStatic } from '../utils/hammer.utils';\nimport { getEventForKey, getInvertedPositionForKey, getPositionForKey } from '../utils/keyboard.utils';\nimport { first, takeUntil } from 'rxjs/operators';\nimport { fromEvent, merge } from 'rxjs';\n\n@Component({\n selector: 'image-cropper',\n templateUrl: './image-cropper.component.html',\n styleUrls: ['./image-cropper.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ImageCropperComponent implements OnChanges, OnInit {\n private settings = new CropperSettings();\n private setImageMaxSizeRetries = 0;\n private moveStart?: MoveStart;\n private loadedImage?: LoadedImage;\n private resizedWhileHidden = false;\n\n safeImgDataUrl?: SafeUrl | string;\n safeTransformStyle?: SafeStyle | string;\n marginLeft: SafeStyle | string = '0px';\n maxSize: Dimensions = {\n width: 0,\n height: 0\n };\n moveTypes = MoveTypes;\n imageVisible = false;\n\n @ViewChild('wrapper', {static: true}) wrapper!: ElementRef;\n @ViewChild('sourceImage', {static: false}) sourceImage!: ElementRef;\n\n @Input() imageChangedEvent?: any;\n @Input() imageURL?: string;\n @Input() imageBase64?: string;\n @Input() imageFile?: File;\n @Input() imageAltText?: string;\n @Input() cropperFrameAriaLabel = this.settings.cropperFrameAriaLabel;\n @Input() output: 'blob' | 'base64' = this.settings.output;\n @Input() format: OutputFormat = this.settings.format;\n @Input() transform: ImageTransform = {};\n @Input() maintainAspectRatio = this.settings.maintainAspectRatio;\n @Input() aspectRatio = this.settings.aspectRatio;\n @Input() resetCropOnAspectRatioChange = this.settings.resetCropOnAspectRatioChange;\n @Input() resizeToWidth = this.settings.resizeToWidth;\n @Input() resizeToHeight = this.settings.resizeToHeight;\n @Input() cropperMinWidth = this.settings.cropperMinWidth;\n @Input() cropperMinHeight = this.settings.cropperMinHeight;\n @Input() cropperMaxHeight = this.settings.cropperMaxHeight;\n @Input() cropperMaxWidth = this.settings.cropperMaxWidth;\n @Input() cropperStaticWidth = this.settings.cropperStaticWidth;\n @Input() cropperStaticHeight = this.settings.cropperStaticHeight;\n @Input() canvasRotation = this.settings.canvasRotation;\n @Input() initialStepSize = this.settings.initialStepSize;\n @Input() roundCropper = this.settings.roundCropper;\n @Input() onlyScaleDown = this.settings.onlyScaleDown;\n @Input() imageQuality = this.settings.imageQuality;\n @Input() autoCrop = this.settings.autoCrop;\n @Input() backgroundColor = this.settings.backgroundColor;\n @Input() containWithinAspectRatio = this.settings.containWithinAspectRatio;\n @Input() hideResizeSquares = this.settings.hideResizeSquares;\n @Input() allowMoveImage = false;\n @Input() cropper: CropperPosition = {\n x1: -100,\n y1: -100,\n x2: 10000,\n y2: 10000\n };\n @HostBinding('style.text-align')\n @Input() alignImage: 'left' | 'center' = this.settings.alignImage;\n @HostBinding('class.disabled')\n @Input() disabled = false;\n @HostBinding('class.ngx-ix-hidden')\n @Input() hidden = false;\n\n @Output() imageCropped = new EventEmitter();\n @Output() startCropImage = new EventEmitter();\n @Output() imageLoaded = new EventEmitter();\n @Output() cropperReady = new EventEmitter();\n @Output() loadImageFailed = new EventEmitter();\n @Output() transformChange = new EventEmitter();\n\n\n constructor(\n private cropService: CropService,\n private cropperPositionService: CropperPositionService,\n private loadImageService: LoadImageService,\n private sanitizer: DomSanitizer,\n private cd: ChangeDetectorRef,\n private zone: NgZone,\n @Optional() @Inject(HAMMER_LOADER) private readonly hammerLoader: HammerLoader | null\n ) {\n this.reset();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.onChangesUpdateSettings(changes);\n this.onChangesInputImage(changes);\n\n if (this.loadedImage?.original.image.complete && (changes['containWithinAspectRatio'] || changes['canvasRotation'])) {\n this.loadImageService\n .transformLoadedImage(this.loadedImage, this.settings)\n .then((res) => this.setLoadedImage(res))\n .catch((err) => this.loadImageError(err));\n }\n if (changes['cropper'] || changes['maintainAspectRatio'] || changes['aspectRatio']) {\n this.setMaxSize();\n this.setCropperScaledMinSize();\n this.setCropperScaledMaxSize();\n if (\n this.maintainAspectRatio &&\n (this.resetCropOnAspectRatioChange || !this.aspectRatioIsCorrect()) &&\n (changes['maintainAspectRatio'] || changes['aspectRatio'])\n ) {\n this.resetCropperPosition();\n } else if (changes['cropper']) {\n this.checkCropperPosition(false);\n this.doAutoCrop();\n }\n }\n if (changes['transform']) {\n this.transform = this.transform || {};\n this.setCssTransform();\n this.doAutoCrop();\n }\n if (changes['hidden'] && this.resizedWhileHidden && !this.hidden) {\n setTimeout(() => {\n this.onResize();\n this.resizedWhileHidden = false;\n });\n }\n }\n\n private onChangesUpdateSettings(changes: SimpleChanges) {\n this.settings.setOptionsFromChanges(changes);\n\n if (this.settings.cropperStaticHeight && this.settings.cropperStaticWidth) {\n this.hideResizeSquares = true;\n this.settings.setOptions({\n hideResizeSquares: true,\n cropperMinWidth: this.settings.cropperStaticWidth,\n cropperMinHeight: this.settings.cropperStaticHeight,\n cropperMaxHeight: this.settings.cropperStaticHeight,\n cropperMaxWidth: this.settings.cropperStaticWidth,\n maintainAspectRatio: false\n });\n }\n }\n\n private onChangesInputImage(changes: SimpleChanges): void {\n if (changes['imageChangedEvent'] || changes['imageURL'] || changes['imageBase64'] || changes['imageFile']) {\n this.reset();\n }\n if (changes['imageChangedEvent'] && this.isValidImageChangedEvent()) {\n this.loadImageFile(this.imageChangedEvent.target.files[0]);\n }\n if (changes['imageURL'] && this.imageURL) {\n this.loadImageFromURL(this.imageURL);\n }\n if (changes['imageBase64'] && this.imageBase64) {\n this.loadBase64Image(this.imageBase64);\n }\n if (changes['imageFile'] && this.imageFile) {\n this.loadImageFile(this.imageFile);\n }\n }\n\n private isValidImageChangedEvent(): boolean {\n return this.imageChangedEvent?.target?.files?.length > 0;\n }\n\n private setCssTransform() {\n const translateUnit = this.transform?.translateUnit || '%';\n this.safeTransformStyle = this.sanitizer.bypassSecurityTrustStyle(\n `translate(${this.transform.translateH || 0}${translateUnit}, ${this.transform.translateV || 0}${translateUnit})` +\n ' scaleX(' + (this.transform.scale || 1) * (this.transform.flipH ? -1 : 1) + ')' +\n ' scaleY(' + (this.transform.scale || 1) * (this.transform.flipV ? -1 : 1) + ')' +\n ' rotate(' + (this.transform.rotate || 0) + 'deg)'\n );\n }\n\n ngOnInit(): void {\n this.settings.stepSize = this.initialStepSize;\n this.activatePinchGesture();\n }\n\n private reset(): void {\n this.imageVisible = false;\n this.loadedImage = undefined;\n this.safeImgDataUrl = 'data:image/png;base64,iVBORw0KGg'\n + 'oAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAU'\n + 'AAarVyFEAAAAASUVORK5CYII=';\n this.moveStart = {\n active: false,\n type: null,\n position: null,\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n clientX: 0,\n clientY: 0\n };\n this.maxSize = {\n width: 0,\n height: 0\n };\n this.cropper.x1 = -100;\n this.cropper.y1 = -100;\n this.cropper.x2 = 10000;\n this.cropper.y2 = 10000;\n }\n\n private loadImageFile(file: File): void {\n this.loadImageService\n .loadImageFile(file, this.settings)\n .then((res) => this.setLoadedImage(res))\n .catch((err) => this.loadImageError(err));\n }\n\n private loadBase64Image(imageBase64: string): void {\n this.loadImageService\n .loadBase64Image(imageBase64, this.settings)\n .then((res) => this.setLoadedImage(res))\n .catch((err) => this.loadImageError(err));\n }\n\n private loadImageFromURL(url: string): void {\n this.loadImageService\n .loadImageFromURL(url, this.settings)\n .then((res) => this.setLoadedImage(res))\n .catch((err) => this.loadImageError(err));\n }\n\n private setLoadedImage(loadedImage: LoadedImage): void {\n this.loadedImage = loadedImage;\n this.safeImgDataUrl = this.sanitizer.bypassSecurityTrustResourceUrl(loadedImage.transformed.objectUrl);\n this.cd.markForCheck();\n }\n\n public loadImageError(error: any): void {\n console.error(error);\n this.loadImageFailed.emit();\n }\n\n imageLoadedInView(): void {\n if (this.loadedImage != null) {\n this.imageLoaded.emit(this.loadedImage);\n this.setImageMaxSizeRetries = 0;\n setTimeout(() => this.checkImageMaxSizeRecursively());\n }\n }\n\n private checkImageMaxSizeRecursively(): void {\n if (this.setImageMaxSizeRetries > 40) {\n this.loadImageFailed.emit();\n } else if (this.sourceImageLoaded()) {\n this.setMaxSize();\n this.setCropperScaledMinSize();\n this.setCropperScaledMaxSize();\n this.resetCropperPosition();\n this.cropperReady.emit({...this.maxSize});\n this.cd.markForCheck();\n } else {\n this.setImageMaxSizeRetries++;\n setTimeout(() => this.checkImageMaxSizeRecursively(), 50);\n }\n }\n\n private sourceImageLoaded(): boolean {\n return this.sourceImage?.nativeElement?.offsetWidth > 0;\n }\n\n @HostListener('window:resize')\n onResize(): void {\n if (!this.loadedImage) {\n return;\n }\n if (this.hidden) {\n this.resizedWhileHidden = true;\n } else {\n const oldMaxSize = {...this.maxSize};\n this.setMaxSize();\n this.resizeCropperPosition(oldMaxSize);\n this.setCropperScaledMinSize();\n this.setCropperScaledMaxSize();\n }\n }\n\n private async activatePinchGesture() {\n // Loads HammerJS via angular APIs if configured\n await this.hammerLoader?.();\n\n const Hammer = (window as unknown as (Window & { Hammer?: HammerStatic }))?.['Hammer'] || null;\n\n if (Hammer) {\n const hammer = new Hammer(this.wrapper.nativeElement);\n hammer.get('pinch').set({enable: true});\n hammer.on('pinchmove', this.onPinch.bind(this));\n hammer.on('pinchend', this.pinchStop.bind(this));\n hammer.on('pinchstart', this.startPinch.bind(this));\n } else if (isDevMode()) {\n console.warn('[NgxImageCropper] Could not find HammerJS - Pinch Gesture won\\'t work');\n }\n }\n\n private resizeCropperPosition(oldMaxSize: Dimensions): void {\n if (oldMaxSize.width !== this.maxSize.width || oldMaxSize.height !== this.maxSize.height) {\n this.cropper.x1 = this.cropper.x1 * this.maxSize.width / oldMaxSize.width;\n this.cropper.x2 = this.cropper.x2 * this.maxSize.width / oldMaxSize.width;\n this.cropper.y1 = this.cropper.y1 * this.maxSize.height / oldMaxSize.height;\n this.cropper.y2 = this.cropper.y2 * this.maxSize.height / oldMaxSize.height;\n }\n }\n\n resetCropperPosition(): void {\n this.cropperPositionService.resetCropperPosition(this.sourceImage, this.cropper, this.settings, this.maxSize);\n this.doAutoCrop();\n this.imageVisible = true;\n }\n\n keyboardAccess(event: KeyboardEvent) {\n this.changeKeyboardStepSize(event);\n this.keyboardMoveCropper(event);\n }\n\n private changeKeyboardStepSize(event: KeyboardEvent): void {\n const key = +event.key;\n if (key >= 1 && key <= 9) {\n this.settings.stepSize = key;\n }\n }\n\n private keyboardMoveCropper(event: any) {\n const keyboardWhiteList: string[] = ['ArrowUp', 'ArrowDown', 'ArrowRight', 'ArrowLeft'];\n if (!(keyboardWhiteList.includes(event.key))) {\n return;\n }\n const moveType = event.shiftKey ? MoveTypes.Resize : MoveTypes.Move;\n const position = event.altKey ? getInvertedPositionForKey(event.key) : getPositionForKey(event.key);\n const moveEvent = getEventForKey(event.key, this.settings.stepSize);\n event.preventDefault();\n event.stopPropagation();\n this.startMove({clientX: 0, clientY: 0}, moveType, position);\n this.handleMouseMove(moveEvent);\n this.handleMouseUp();\n }\n\n startMove(event: any, moveType: MoveTypes, position: string | null = null): void {\n if (this.disabled\n || this.moveStart?.active && this.moveStart?.type === MoveTypes.Pinch\n || moveType === MoveTypes.Drag && !this.allowMoveImage) {\n return;\n }\n if (event.preventDefault) {\n event.preventDefault();\n }\n this.moveStart = {\n active: true,\n type: moveType,\n position,\n transform: {...this.transform},\n clientX: this.cropperPositionService.getClientX(event),\n clientY: this.cropperPositionService.getClientY(event),\n ...this.cropper\n };\n this.initMouseMove();\n }\n\n private initMouseMove(): void {\n merge(\n fromEvent(document, 'mousemove'),\n fromEvent(document, 'touchmove')\n ).pipe(\n takeUntil(merge(\n fromEvent(document, 'mouseup'),\n fromEvent(document, 'touchend')\n ).pipe(first()))\n )\n .subscribe({\n next: (event) => this.zone.run(() => {\n this.handleMouseMove(event);\n this.cd.markForCheck();\n }),\n complete: () => this.zone.run(() => {\n this.handleMouseUp();\n this.cd.markForCheck();\n })\n });\n }\n\n startPinch(event: any) {\n if (!this.safeImgDataUrl) {\n return;\n }\n if (event.preventDefault) {\n event.preventDefault();\n }\n this.moveStart = {\n active: true,\n type: MoveTypes.Pinch,\n position: 'center',\n clientX: this.cropper.x1 + (this.cropper.x2 - this.cropper.x1) / 2,\n clientY: this.cropper.y1 + (this.cropper.y2 - this.cropper.y1) / 2,\n ...this.cropper\n };\n }\n\n private handleMouseMove(event: any): void {\n if (this.moveStart!.active) {\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (this.moveStart!.type === MoveTypes.Move) {\n this.cropperPositionService.move(event, this.moveStart!, this.cropper);\n this.checkCropperPosition(true);\n } else if (this.moveStart!.type === MoveTypes.Resize) {\n if (!this.cropperStaticWidth && !this.cropperStaticHeight) {\n this.cropperPositionService.resize(event, this.moveStart!, this.cropper, this.maxSize, this.settings);\n }\n this.checkCropperPosition(false);\n } else if (this.moveStart!.type === MoveTypes.Drag) {\n const diffX = this.cropperPositionService.getClientX(event) - this.moveStart!.clientX;\n const diffY = this.cropperPositionService.getClientY(event) - this.moveStart!.clientY;\n this.transform = {\n ...this.transform,\n translateH: (this.moveStart!.transform?.translateH || 0) + diffX,\n translateV: (this.moveStart!.transform?.translateV || 0) + diffY\n };\n this.setCssTransform();\n }\n }\n }\n\n onPinch(event: any) {\n if (this.moveStart!.active) {\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (this.moveStart!.type === MoveTypes.Pinch) {\n this.cropperPositionService.resize(event, this.moveStart!, this.cropper, this.maxSize, this.settings);\n this.checkCropperPosition(false);\n }\n this.cd.markForCheck();\n }\n }\n\n private setMaxSize(): void {\n if (this.sourceImage) {\n const sourceImageStyle = getComputedStyle(this.sourceImage.nativeElement);\n this.maxSize.width = parseFloat(sourceImageStyle.width);\n this.maxSize.height = parseFloat(sourceImageStyle.height);\n this.marginLeft = this.sanitizer.bypassSecurityTrustStyle('calc(50% - ' + this.maxSize.width / 2 + 'px)');\n }\n }\n\n private setCropperScaledMinSize(): void {\n if (this.loadedImage?.transformed?.image) {\n this.setCropperScaledMinWidth();\n this.setCropperScaledMinHeight();\n } else {\n this.settings.cropperScaledMinWidth = 20;\n this.settings.cropperScaledMinHeight = 20;\n }\n }\n\n private setCropperScaledMinWidth(): void {\n this.settings.cropperScaledMinWidth = this.cropperMinWidth > 0\n ? Math.max(20, this.cropperMinWidth / this.loadedImage!.transformed.image.width * this.maxSize.width)\n : 20;\n }\n\n private setCropperScaledMinHeight(): void {\n if (this.maintainAspectRatio) {\n this.settings.cropperScaledMinHeight = Math.max(20, this.settings.cropperScaledMinWidth / this.aspectRatio);\n } else if (this.cropperMinHeight > 0) {\n this.settings.cropperScaledMinHeight = Math.max(\n 20,\n this.cropperMinHeight / this.loadedImage!.transformed.image.height * this.maxSize.height\n );\n } else {\n this.settings.cropperScaledMinHeight = 20;\n }\n }\n\n private setCropperScaledMaxSize(): void {\n if (this.loadedImage?.transformed?.image) {\n const ratio = this.loadedImage.transformed.size.width / this.maxSize.width;\n this.settings.cropperScaledMaxWidth = this.cropperMaxWidth > 20 ? this.cropperMaxWidth / ratio : this.maxSize.width;\n this.settings.cropperScaledMaxHeight = this.cropperMaxHeight > 20 ? this.cropperMaxHeight / ratio : this.maxSize.height;\n if (this.maintainAspectRatio) {\n if (this.settings.cropperScaledMaxWidth > this.settings.cropperScaledMaxHeight * this.aspectRatio) {\n this.settings.cropperScaledMaxWidth = this.settings.cropperScaledMaxHeight * this.aspectRatio;\n } else if (this.settings.cropperScaledMaxWidth < this.settings.cropperScaledMaxHeight * this.aspectRatio) {\n this.settings.cropperScaledMaxHeight = this.settings.cropperScaledMaxWidth / this.aspectRatio;\n }\n }\n } else {\n this.settings.cropperScaledMaxWidth = this.maxSize.width;\n this.settings.cropperScaledMaxHeight = this.maxSize.height;\n }\n }\n\n private checkCropperPosition(maintainSize = false): void {\n if (this.cropper.x1 < 0) {\n this.cropper.x2 -= maintainSize ? this.cropper.x1 : 0;\n this.cropper.x1 = 0;\n }\n if (this.cropper.y1 < 0) {\n this.cropper.y2 -= maintainSize ? this.cropper.y1 : 0;\n this.cropper.y1 = 0;\n }\n if (this.cropper.x2 > this.maxSize.width) {\n this.cropper.x1 -= maintainSize ? (this.cropper.x2 - this.maxSize.width) : 0;\n this.cropper.x2 = this.maxSize.width;\n }\n if (this.cropper.y2 > this.maxSize.height) {\n this.cropper.y1 -= maintainSize ? (this.cropper.y2 - this.maxSize.height) : 0;\n this.cropper.y2 = this.maxSize.height;\n }\n }\n\n private handleMouseUp(): void {\n if (this.moveStart!.active) {\n this.moveStart!.active = false;\n if (this.moveStart?.type === MoveTypes.Drag) {\n this.transformChange.emit(this.transform);\n } else {\n this.doAutoCrop();\n }\n }\n }\n\n pinchStop(): void {\n if (this.moveStart!.active) {\n this.moveStart!.active = false;\n this.doAutoCrop();\n }\n }\n\n private doAutoCrop(): void {\n if (this.autoCrop) {\n void this.crop();\n }\n }\n\n crop(): ImageCroppedEvent | null;\n crop(output: 'base64'): ImageCroppedEvent | null;\n crop(output: 'blob'): Promise | null;\n crop(output: OutputType = this.settings.output): Promise | ImageCroppedEvent | null {\n if (this.loadedImage?.transformed?.image != null) {\n this.startCropImage.emit();\n if (output === 'blob') {\n return this.cropToBlob();\n } else if (output === 'base64') {\n return this.cropToBase64();\n }\n }\n return null;\n }\n\n private cropToBlob(): Promise | null {\n return new Promise((resolve, reject) => this.zone.run(async () => {\n const result = await this.cropService.crop(this.loadedImage!, this.cropper, this.settings, 'blob', this.maxSize);\n if (result) {\n this.imageCropped.emit(result);\n resolve(result);\n } else {\n reject('Crop image failed');\n }\n }));\n }\n\n private cropToBase64(): ImageCroppedEvent | null {\n const result = this.cropService.crop(this.loadedImage!, this.cropper, this.settings, 'base64', this.maxSize);\n if (result) {\n this.imageCropped.emit(result);\n return result;\n }\n return null;\n }\n\n private aspectRatioIsCorrect(): boolean {\n const currentCropAspectRatio = (this.cropper.x2 - this.cropper.x1) / (this.cropper.y2 - this.cropper.y1);\n return currentCropAspectRatio === this.aspectRatio;\n }\n}\n","\n \n \n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ImageCropperComponent } from './component/image-cropper.component';\n\n@NgModule({\n imports: [\n CommonModule\n ],\n declarations: [\n ImageCropperComponent,\n\n ],\n exports: [\n ImageCropperComponent\n ]\n})\nexport class ImageCropperModule {\n}\n","export function base64ToFile(base64Image: string): Blob {\n const split = base64Image.split(',');\n const type = split[0].replace('data:', '').replace(';base64', '');\n const byteString = atob(split[1]);\n const ab = new ArrayBuffer(byteString.length);\n const ia = new Uint8Array(ab);\n for (let i = 0; i < byteString.length; i += 1) {\n ia[i] = byteString.charCodeAt(i);\n }\n return new Blob([ab], {type});\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;MAIa,eAAe;IAA5B;;QAGE,WAAM,GAAiB,KAAK,CAAC;QAC7B,WAAM,GAAe,MAAM,CAAC;QAC5B,wBAAmB,GAAG,IAAI,CAAC;QAC3B,cAAS,GAAmB,EAAE,CAAC;QAC/B,gBAAW,GAAG,CAAC,CAAC;QAChB,iCAA4B,GAAG,IAAI,CAAC;QACpC,kBAAa,GAAG,CAAC,CAAC;QAClB,mBAAc,GAAG,CAAC,CAAC;QACnB,oBAAe,GAAG,CAAC,CAAC;QACpB,qBAAgB,GAAG,CAAC,CAAC;QACrB,qBAAgB,GAAG,CAAC,CAAC;QACrB,oBAAe,GAAG,CAAC,CAAC;QACpB,uBAAkB,GAAG,CAAC,CAAC;QACvB,wBAAmB,GAAG,CAAC,CAAC;QACxB,mBAAc,GAAG,CAAC,CAAC;QACnB,oBAAe,GAAG,CAAC,CAAC;QACpB,iBAAY,GAAG,KAAK,CAAC;QACrB,kBAAa,GAAG,KAAK,CAAC;QACtB,iBAAY,GAAG,EAAE,CAAC;QAClB,aAAQ,GAAG,IAAI,CAAC;QAChB,oBAAe,GAAkB,IAAI,CAAC;QACtC,6BAAwB,GAAG,KAAK,CAAC;QACjC,sBAAiB,GAAG,KAAK,CAAC;QAC1B,eAAU,GAAsB,QAAQ,CAAC;QACzC,0BAAqB,GAAG,YAAY,CAAC;;QAGrC,0BAAqB,GAAG,EAAE,CAAC;QAC3B,2BAAsB,GAAG,EAAE,CAAC;QAC5B,0BAAqB,GAAG,EAAE,CAAC;QAC3B,2BAAsB,GAAG,EAAE,CAAC;QAC5B,aAAQ,GAAG,IAAI,CAAC,eAAe,CAAC;KAqBjC;IAnBC,UAAU,CAAC,OAAgC;QACzC,MAAM,CAAC,IAAI,CAAC,OAAO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