{"_id":"@378q/ngx-photo-editor","_rev":"1-c7c29c57da79669c31c7df6ecd1dbb34","name":"@378q/ngx-photo-editor","dist-tags":{"latest":"0.4.5"},"versions":{"0.4.2":{"name":"@378q/ngx-photo-editor","version":"0.4.2","publishConfig":{"access":"public"},"description":"An image cropper for Angular","author":{"name":"Ahamed Bilal","email":"ahamedbilalazmy@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/AhamedBilal/ngx-photo-editor.git"},"homepage":"https://ahamedbilal.github.io/ngx-photo-editor/","bugs":{"url":"https://github.com/AhamedBilal/ngx-photo-editor/issues"},"keywords":["angular 2","angular 4","angular 6","angular 7","angular 8","angular 9","angular 10","angular 11","angular 12","angular 13","angular 14","image","image editor","photo editor","editor","cropper","cropperjs","ngx-cropper","angular cropper","angular photo editor","angular image cropper","ngx","ngx photo editor","ngx cropper","image cropper","popup cropper"],"license":"MIT","peerDependencies":{"@angular/common":">=14.0.0-0","@angular/core":">=14.0.0-0"},"dependencies":{"cropperjs":">=1.5.12-0","tslib":"^2.3.0"},"exports":{"./":{"default":"./photo-editor.css"},"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2020":"./esm2020/378q-ngx-photo-editor.mjs","es2020":"./fesm2020/378q-ngx-photo-editor.mjs","es2015":"./fesm2015/378q-ngx-photo-editor.mjs","node":"./fesm2015/378q-ngx-photo-editor.mjs","default":"./fesm2020/378q-ngx-photo-editor.mjs"}},"module":"fesm2015/378q-ngx-photo-editor.mjs","es2020":"fesm2020/378q-ngx-photo-editor.mjs","esm2020":"esm2020/378q-ngx-photo-editor.mjs","fesm2020":"fesm2020/378q-ngx-photo-editor.mjs","fesm2015":"fesm2015/378q-ngx-photo-editor.mjs","typings":"index.d.ts","sideEffects":false,"gitHead":"c09c7b18133a6a0b3ac1787976315643779f6153","_id":"@378q/ngx-photo-editor@0.4.2","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-ElhfonHVlfb6OJwLAJefZ4Yd6kloSllw405amRS7HNDKp1wkYb7+3X46484KTMwY2o9oJM60bIVwAQ4V9U7W1g==","shasum":"df0b9e316429b4bb6db96c578ae6bac0e867774e","tarball":"https://registry.npmjs.org/@378q/ngx-photo-editor/-/ngx-photo-editor-0.4.2.tgz","fileCount":17,"unpackedSize":236058,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1+YFK+p9tnmIL0XKJHC5W0VSZGT0BeUyE7H59DNJlUwIhALD+d05xd0JD6mCuOU6wzyH7HxNnDAewZQasNjYAGLdi"}]},"_npmUser":{"name":"zxfishh_ck","email":"zxfishhack@126.com"},"directories":{},"maintainers":[{"name":"zxfishh_ck","email":"zxfishhack@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-photo-editor_0.4.2_1697009039861_0.875729064189698"},"_hasShrinkwrap":false},"0.4.5":{"name":"@378q/ngx-photo-editor","version":"0.4.5","description":"An image cropper for Angular","publishConfig":{"access":"public"},"author":{"name":"Ahamed Bilal","email":"ahamedbilalazmy@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/AhamedBilal/ngx-photo-editor.git"},"homepage":"https://ahamedbilal.github.io/ngx-photo-editor/","bugs":{"url":"https://github.com/AhamedBilal/ngx-photo-editor/issues"},"keywords":["angular 6","angular 7","angular 8","angular 9","angular 10","angular 11","angular 12","angular 13","angular 14","image","image editor","photo editor","editor","cropper","cropperjs","ngx-cropper","angular cropper","angular photo editor","angular image cropper","ngx","ngx photo editor","ngx cropper","image cropper","popup cropper"],"license":"MIT","peerDependencies":{"@angular/common":">=10.0.0","@angular/core":">=10.0.0"},"dependencies":{"cropperjs":">=1.5.12","tslib":"^2.3.0"},"exports":{"./":{"default":"./photo-editor.css"},"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","esm2020":"./esm2020/378q-ngx-photo-editor.mjs","es2020":"./fesm2020/378q-ngx-photo-editor.mjs","es2015":"./fesm2015/378q-ngx-photo-editor.mjs","node":"./fesm2015/378q-ngx-photo-editor.mjs","default":"./fesm2020/378q-ngx-photo-editor.mjs"}},"module":"fesm2015/378q-ngx-photo-editor.mjs","es2020":"fesm2020/378q-ngx-photo-editor.mjs","esm2020":"esm2020/378q-ngx-photo-editor.mjs","fesm2020":"fesm2020/378q-ngx-photo-editor.mjs","fesm2015":"fesm2015/378q-ngx-photo-editor.mjs","typings":"index.d.ts","sideEffects":false,"gitHead":"29eae93e29598d9cb60a961377c825a30e4fd848","_id":"@378q/ngx-photo-editor@0.4.5","_nodeVersion":"16.20.2","_npmVersion":"8.19.4","dist":{"integrity":"sha512-nv3vDt/r47rBJEm00w9wEKOFJFDY3HSFzWwG4YCdXc+w1cEhAJIa8mAMAIREU0ZLXpmcQv/n8hM7QWPWFrMC/g==","shasum":"ee0d798731d5ebf870b12d24340d9093bb3eb86f","tarball":"https://registry.npmjs.org/@378q/ngx-photo-editor/-/ngx-photo-editor-0.4.5.tgz","fileCount":17,"unpackedSize":236151,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH6vMpXSrIp/Z3bQG7ZzKt/qT1anp3OK209m8G7CNe80AiAFn+nlL+nU1D5v8Vb0t5W5T2B4BpacIVudOvWI3xGVuw=="}]},"_npmUser":{"name":"zxfishh_ck","email":"zxfishhack@126.com"},"directories":{},"maintainers":[{"name":"zxfishh_ck","email":"zxfishhack@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ngx-photo-editor_0.4.5_1697010853674_0.31142084377601775"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-11T07:23:59.767Z","0.4.2":"2023-10-11T07:24:00.098Z","modified":"2023-10-11T07:54:14.172Z","0.4.5":"2023-10-11T07:54:13.960Z"},"maintainers":[{"name":"zxfishh_ck","email":"zxfishhack@126.com"}],"description":"An image cropper for Angular","homepage":"https://ahamedbilal.github.io/ngx-photo-editor/","keywords":["angular 6","angular 7","angular 8","angular 9","angular 10","angular 11","angular 12","angular 13","angular 14","image","image editor","photo editor","editor","cropper","cropperjs","ngx-cropper","angular cropper","angular photo editor","angular image cropper","ngx","ngx photo editor","ngx cropper","image cropper","popup cropper"],"repository":{"type":"git","url":"git+https://github.com/AhamedBilal/ngx-photo-editor.git"},"author":{"name":"Ahamed Bilal","email":"ahamedbilalazmy@gmail.com"},"bugs":{"url":"https://github.com/AhamedBilal/ngx-photo-editor/issues"},"license":"MIT","readme":"# Image Cropper for Angular\n[![NPM version][npm-img]][npm-url]\n[![The MIT License][license-img]][license]\n[![The MIT License][downloads-img]][downloads]\n\n![example](https://github.com/AhamedBilal/ngx-photo-editor/blob/master/intro.gif?raw=true)\n\n### [Demo](https://ahamedbilal.github.io/ngx-photo-editor/)\n\n## Features\n\n-   NgxPhotoEditor Component Injection without being passed  `ViewContainerRef`\n- High performance\n- Highly configurable and customizable\n- Overridable styles\n- Fully Supported\n\n## Install\n\n```bash  \n   npm install ngx-photo-editor --save  \n```\n## Setup\n#### Step 1:\n- Import CSS.\n```css\n@import \"~ngx-photo-editor/photo-editor.css\";\n``` \n-   If you are using angular-cli you can add it to your angular.json\n```\n\"styles\": [\n  \"styles.scss\",\n  \"node_modules/ngx-photo-editor/photo-editor.css\" // try adding '../' if you're using angular cli before 6\n]\n```\n#### Step 2:\n- Add NgxPhotoEditorModule to app.module.ts\n```ts\nimport {NgModule} from '@angular/core';\nimport {BrowserModule} from '@angular/platform-browser';\nimport {AppComponent} from './app.component';\nimport {NgxPhotoEditorModule} from \"ngx-photo-editor\";\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    NgxPhotoEditorModule,\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n\n```\n## Usage\n```html  \n<input type=\"file\" (change)=\"fileChangeHandler($event)\">\n<img [src]=\"output?.base64\" alt=\"\">\n```  \n\nAnd add this to your .ts file:\n```ts  \nimport {Component} from '@angular/core';\nimport {NgxCroppedEvent, NgxPhotoEditorService} from \"ngx-photo-editor\";\n\n@Component({...})\nexport class AppComponent {\n  output?: NgxCroppedEvent;\n\n  constructor(private service: NgxPhotoEditorService) {}\n\n  fileChangeHandler($event: any) {\n    this.service.open($event, {\n      aspectRatio: 4 / 3,\n      autoCropArea: 1\n    }).subscribe(data => {\n      this.output = data;\n    });\n  }\n}\n```    \n\nYou can pass any supported type of parameters to `NgxPhotoEditorService.open()` to open the cropper.  After click `Apply` button the observer will return an object with the cropped image as a Base64, Blob in its payload.\n\n## Parameters\n| Name | Type | Description|\n|--|--|--|\n| `source` |`FileEvent | File | Blob | string` |Only image URL string, image related sources are supported.|\n|`options`|`check below para`|This is an optional parameter\n\n\n\n## Options\n| Name| Type| Default| Description|\n|-|-|-|-|  \n|`format`|string|source Image format| Output format (png, jpeg, webp, bmp, ico) (not all browsers support all types, png is always supported, others are optional)|\n| `aspectRatio` | number    | `NaN`        | The width / height ratio (e.g. 1 / 1 for a square, 4 / 3, 16 / 9 ...)                                                                                                                                                                |  \n| `resizeToWidth` | number    | 0 (disabled) | Cropped image will be resized to this width (in px)                                                                                                                                                                                  |  \n| `resizeToHeight` | number    | 0 (disabled) | Cropped image will be resized to this height (in px)                                                                                                                                       |  \n| `roundCropper` | boolean   | false        | Set this to true for a round cropper mask. Resulting image will still be square, use `border-radius: 100%` on resulting image to show it as round.                                                                                        |  \n| `imageQuality` | number    | 92           | This only applies when using jpeg or webp as output format. Entering a number between 0 and 100 will determine the quality of the output image.                                                                                      |  \n| `autoCrop` | boolean   | true         | Enable to crop the image automatically when initialized.                                                                                                                                                                             |  \n| `autoCropArea` | number    | 1 (80% of the image)| A number between 0 and 1. Define the automatic cropping area size (percentage).                                                                                                                                                      |  \n| `viewMode` | number    | 0            | Define the [ViewMode](#viewMode) of the cropper.                                                                                                                                                                                     |  \n| `mask` | boolean   | true         | Show the black modal above the image and under the crop box.                                                                                                                                                                         |  \n| `guides` | boolean   | true         | Show the dashed lines above the crop box.                                                                                                                                                                                            |  \n| `centerIndicator` | boolean   | true         | Show the center indicator above the crop box.                                                                                                                                                                                        |   \n| `scalable` | boolean   | true         | Enable to scale the image.                                                                                                                                                                                                           |  \n| `zoomable` | boolean   | true         | Enable to zoom the image.                                                                                                                                                                                                            |  \n| `cropBoxMovable` | boolean   | true         | Enable to move the crop box by dragging.                                                                                                                                                                                             |  \n| `cropBoxResizable` | boolean   | true         | Enable to resize the crop box by dragging.                                                                                                                                                                                           |  \n| `imageSmoothingEnabled` | boolean   | true         | Smooth image output.                                                                                                                                                                                                                 |  \n| `imageSmoothingQuality` | string    | low         | quality of image smoothing, one of \"low\" or \"medium\", or \"high\".|\n| `modalMaxWidth` | string    | '500px'| max-width property of the dialog container                                                                                                                                                                                                     |  \n| `hideModalHeader` | boolean   | false        | Hide Modal Header.                                                                                                                                                                                                                   |    \n|`applyBtnText`| string | Apply | Apply button text|\n|`closeBtnText`| string | Close | Close button text|\n\n\n## Interfaces\n#### NgxCroppedEvent\n| Property | Type | Description |  \n| --  | --| -- |  \n| base64 | string          | Base64 string of the cropped image |  \n| file | file(Blob)      | Blob(File) of the cropped image |\n\n### viewMode\n\n- Type: `Number`\n- Default: `0`\n- Options:\n  - `0`: no restrictions\n  - `1`: restrict the crop box to not exceed the size of the canvas.\n  - `2`: restrict the minimum canvas size to fit within the container. If the proportions of the canvas and the container differ, the minimum canvas will be surrounded by extra space in one of the dimensions.\n  - `3`: restrict the minimum canvas size to fill fit the container. If the proportions of the canvas and the container are different, the container will not be able to fit the whole canvas in one of the dimensions.\n\nDefine the view mode of the cropper. If you set `viewMode` to `0`, the crop box can extend outside the canvas, while a value of `1`, `2` or `3` will restrict the crop box to the size of the canvas. A `viewMode` of `2` or `3` will additionally restrict the canvas to the container. Note that if the proportions of the canvas and the container are the same, there is no difference between `2` and `3`.\n\n\n[npm-url]: https://www.npmjs.com/package/ngx-photo-editor\n[npm-img]: https://img.shields.io/npm/v/ngx-photo-editor?style=flat-square\n[license]:http://opensource.org/licenses/MIT\n[license-img]:https://img.shields.io/badge/license-MIT-orange.svg?color=blue&style=flat-square\n[downloads]:https://img.shields.io/npm/dt/ngx-photo-editor?style=flat-square\n[downloads-img]:https://img.shields.io/npm/dt/ngx-photo-editor?style=flat-square\n","readmeFilename":"README.md"}