Gathering detailed insights and metrics for ngx-img-cropper-patched2
Gathering detailed insights and metrics for ngx-img-cropper-patched2
This is a patched version of ngx-img-cropper(https://github.com/web-dave/ngx-img-cropper) to support Angular 4
npm install ngx-img-cropper-patched2
Typescript
Module System
Node Version
NPM Version
72.4
Supply Chain
95.3
Quality
75.3
Maintenance
50
Vulnerability
98.2
License
TypeScript (91.2%)
HTML (6.34%)
JavaScript (2%)
CSS (0.47%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,091
Last Day
2
Last Week
3
Last Month
24
Last Year
109
MIT License
317 Commits
2 Watchers
2 Branches
1 Contributors
Updated on Sep 12, 2018
Minified
Minified + Gzipped
Latest Version
0.10.10
Package Id
ngx-img-cropper-patched2@0.10.10
Unpacked Size
371.75 kB
Size
64.30 kB
File Count
71
NPM Version
4.2.0
Node Version
7.8.0
Cumulative downloads
Total Downloads
Last Day
100%
2
Compared to previous day
Last Week
-57.1%
3
Compared to previous week
Last Month
84.6%
24
Compared to previous month
Last Year
-0.9%
109
Compared to previous year
3
npm i ng4-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: `<div> 7 <img-cropper [image]="data" [settings]="cropperSettings"></img-cropper><br> 8 <img [src]="data.image" [width]="cropperSettings.croppedWidth" [height]="cropperSettings.croppedHeight"> 9 </div>`, 10 declarations: [ImageCropperComponent] 11}) 12export class AppComponent { 13 data: any; 14 cropperSettings: CropperSettings; 15 16 constructor() { 17 this.cropperSettings = new CropperSettings(); 18 this.cropperSettings.width = 100; 19 this.cropperSettings.height = 100; 20 this.cropperSettings.croppedWidth = 100; 21 this.cropperSettings.croppedHeight = 100; 22 this.cropperSettings.canvasWidth = 400; 23 this.cropperSettings.canvasHeight = 300; 24 25 this.data = {}; 26 } 27}
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 [src]="data.image" [width]="cropperSettings.croppedWidth" [height]="cropperSettings.croppedHeight"> 9</span>
1data:any; 2 3@ViewChild('cropper', undefined) 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}
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.