Gathering detailed insights and metrics for @picturelink/ngx-image-compress
Gathering detailed insights and metrics for @picturelink/ngx-image-compress
npm install @picturelink/ngx-image-compress
Typescript
Module System
Node Version
NPM Version
TypeScript (85.75%)
HTML (12.07%)
JavaScript (1.3%)
SCSS (0.88%)
Total Downloads
675
Last Day
1
Last Week
1
Last Month
3
Last Year
75
88 Stars
284 Commits
36 Forks
3 Watching
5 Branches
11 Contributors
Minified
Minified + Gzipped
Latest Version
8.0.4-beta.0
Package Id
@picturelink/ngx-image-compress@8.0.4-beta.0
Unpacked Size
203.60 kB
Size
27.84 kB
File Count
26
NPM Version
6.14.4
Node Version
14.2.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
-50%
1
Compared to previous week
Last month
0%
3
Compared to previous month
Last year
-71.3%
75
Compared to previous year
1
2
Angular utility for compressing images to a satisfying size, that you can choose
1npm i ngx-image-compress
Example here: https://stackblitz.com/edit/ngx-compress-sample
Import it in your app module
1import {BrowserModule} from '@angular/platform-browser'; 2import {NgModule} from '@angular/core'; 3 4import {AppComponent} from './app.component'; 5import {NgxImageCompressService} from 'ngx-image-compress'; 6 7@NgModule({ 8 declarations: [AppComponent], 9 imports: [BrowserModule], 10 providers: [NgxImageCompressService], 11 bootstrap: [AppComponent] 12}) 13export class AppModule {}
Use it in your component
1import {Component} from '@angular/core'; 2import {NgxImageCompressService} from 'ngx-image-compress'; 3 4 5@Component({ 6 selector: 'app-root', 7 template: ` 8 <div> 9 <button (click)="compressFile()">Upload and compress Image</button> 10 <img *ngIf="imgResultBeforeCompress" [src]="imgResultBeforeCompress" alt=""> 11 <img *ngIf="imgResultAfterCompress" [src]="imgResultAfterCompress" alt=""> 12 </div> 13 ` 14}) 15export class AppComponent { 16 17 constructor(private imageCompress: NgxImageCompressService) {} 18 19 imgResultBeforeCompress:string; 20 imgResultAfterCompress:string; 21 22 compressFile() { 23 24 this.imageCompress.uploadFile().then(({image, orientation}) => { 25 26 this.imgResultBeforeCompress = image; 27 console.warn('Size in bytes was:', this.imageCompress.byteCount(image)); 28 29 this.imageCompress.compressFile(image, orientation, 50, 50).then( 30 result => { 31 this.imgResultAfterCompress = result; 32 console.warn('Size in bytes is now:', this.imageCompress.byteCount(result)); 33 } 34 ); 35 36 }); 37 38 } 39}
We will use Renderer2, and transform the image multiple time through HTML canvas encrustation. In fact you can use the static version into the library and import renderer by yourself.
Update to Angular 8 (angular 7 is enough)
Fix DOC_ORIENTATION import (not a required import)
Since Angular 6 include its own packaging system, I no longer need my webpack config to build it. Everything is working in angular 7 without complaint now (test app is on github)
Adding Live example.
Everything is now working and tested but I will make some arrangement to the code in index.ts
before submitting it again to npm
, in order to make it more handy.
Upload to Github Need some fixes and tests to be use as a static library
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
Found 1/22 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More