angular2-resizing-cropping-image
Advanced tools
+53
| # Resizing & cropping images with Angular 2 | ||
| ## Install | ||
| ```bash | ||
| # install the repo with npm | ||
| npm install angular2-resizing-cropping-image | ||
| ``` | ||
| ## Example | ||
| ```js | ||
| # import | ||
| import { LyResizingCroppingImagesModule } from 'angular2-resizing-cropping-image'; | ||
| @NgModule({ | ||
| imports : [LyResizingCroppingImagesModule, ...], | ||
| }) | ||
| ``` | ||
| ```js | ||
| import { Component } from '@angular/core'; | ||
| @Component({ | ||
| selector: 'image-upload', | ||
| styles: [` | ||
| :host{ | ||
| display: block | ||
| } | ||
| `], | ||
| template: ` | ||
| <input (change)="_img.imgChange($event)" type="file"> | ||
| <button (click)="_img.zoom('+')">+</button> | ||
| <button (click)="_img.zoom('-')">-</button> | ||
| <button (click)="_img.center()">center</button> | ||
| <ly-cropping #_img format="png"></ly-cropping> | ||
| <div>Format input: {{_img._img.type}}</div> | ||
| <br /> | ||
| <div>Format output: {{_img.format}}</div> | ||
| <br /> | ||
| <div>Result: </div> | ||
| <br /> | ||
| <img [src]="_img.imgCrop"> | ||
| <br /> | ||
| <input [(ngModel)]="_img.sizeW" placeholder="_img size W"> | ||
| <input [(ngModel)]="_img.sizeH" placeholder="_img size H"> | ||
| <input [(ngModel)]="_img.img" placeholder="Img"> | ||
| ` | ||
| }) | ||
| export class imgUpload { | ||
| constructor(){ | ||
| } | ||
| } | ||
| ``` | ||
| <img src="https://firebasestorage.googleapis.com/v0/b/head-expeditions.appspot.com/o/img.png?alt=media&token=cab4d571-fce8-4a2a-8cbf-4441c94a637b"> |
+1
-1
| { | ||
| "name": "angular2-resizing-cropping-image", | ||
| "version": "1.0.0-final.0", | ||
| "version": "1.0.0-final.1", | ||
| "description": "Resizing and cropping images with Angular 4", | ||
@@ -5,0 +5,0 @@ "main": "bundles/ly.resizing-cropping-image.umd.js", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
57230
2.41%9
12.5%1
-50%54
Infinity%0
-100%