Gathering detailed insights and metrics for ngx-img-cropper
Gathering detailed insights and metrics for ngx-img-cropper
npm install ngx-img-cropper
Typescript
Module System
Node Version
NPM Version
78.1
Supply Chain
97.4
Quality
75.8
Maintenance
100
Vulnerability
98.6
License
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
4,240,943
Last Day
2,038
Last Week
8,982
Last Month
40,381
Last Year
384,793
Minified
Minified + Gzipped
Latest Version
14.0.1
Package Id
ngx-img-cropper@14.0.1
Unpacked Size
1.04 MB
Size
195.33 kB
File Count
69
NPM Version
8.15.0
Node Version
16.17.1
Cumulative downloads
Total Downloads
Last Day
6.9%
2,038
Compared to previous day
Last Week
2.5%
8,982
Compared to previous week
Last Month
49.9%
40,381
Compared to previous month
Last Year
-36.6%
384,793
Compared to previous year
1
2
An image cropping tool for Angular. Features a rectangular crop area. The crop area's aspect ratio can be enforced during dragging. The crop image can either be 1:1 or scaled to fit an area.
npm i ngx-img-cropper --save
git clone
npm i
npm start
Do your magic
create a branch for your feature and send a PR
Let's do awesome stuff!
npm install
npm run all
1import { Component } from 'angular2/core'; 2import { ImageCropperComponent, CropperSettings } from 'ngx-img-cropper'; 3 4@Component({ 5 selector: 'test-app', 6 template: ` 7 <div> 8 <img-cropper [image]="data" [settings]="cropperSettings"></img-cropper 9 ><br /> 10 <img 11 [src]="data.image" 12 [width]="cropperSettings.croppedWidth" 13 [height]="cropperSettings.croppedHeight" 14 /> 15 </div> 16 `, 17 declarations: [ImageCropperComponent] 18}) 19export class AppComponent { 20 data: any; 21 cropperSettings: CropperSettings; 22 23 constructor() { 24 this.cropperSettings = new CropperSettings(); 25 this.cropperSettings.width = 100; 26 this.cropperSettings.height = 100; 27 this.cropperSettings.croppedWidth = 100; 28 this.cropperSettings.croppedHeight = 100; 29 this.cropperSettings.canvasWidth = 400; 30 this.cropperSettings.canvasHeight = 300; 31 32 this.data = {}; 33 } 34}
Checkout this sample plunker
width
and height
of the crop window is retained during resizingReplacing component file input:
1<div class="file-upload"> 2 <span class="text">upload</span> 3 <input id="custom-input" type="file" (change)="fileChangeListener($event)" /> 4</div> 5<img-cropper #cropper [image]="data" [settings]="cropperSettings"></img-cropper> 6<br /> 7<span class="result rounded" *ngIf="data.image"> 8 <img 9 [src]="data.image" 10 [width]="cropperSettings.croppedWidth" 11 [height]="cropperSettings.croppedHeight" 12 /> 13</span>
1data:any; 2 3@ViewChild('cropper') 4cropper:ImageCropperComponent; 5 6constructor() { 7 this.cropperSettings = new CropperSettings(); 8 this.cropperSettings.noFileInput = true; 9 this.data = {}; 10} 11 12fileChangeListener($event) { 13 var image:any = new Image(); 14 var file:File = $event.target.files[0]; 15 var myReader:FileReader = new FileReader(); 16 var that = this; 17 myReader.onloadend = function (loadEvent:any) { 18 image.src = loadEvent.target.result; 19 that.cropper.setImage(image); 20 21 }; 22 23 myReader.readAsDataURL(file); 24}
IOS Fix
Angular 5 support
Fix for #36 - Add button to crop Fix for #186 - Handle Hi-Res images Fix for #92 - IOS crop issue
Starting with: 0.4.2 ts files are no loger published (only js & d.ts). Please change your system.config files to make use of the js files.
'ngx-img-cropper' : { main: 'index.js', defaultExtension: 'js' }
should work with one of these
"release:patch": "npm version patch && npm run release",
"release:minor": "npm version minor && npm run release",
"release:major": "npm version major && npm run release",
Steps:
No vulnerabilities found.
No security vulnerabilities found.