For Andular 4 use "ng2-image-compress": "1.0.17"
ng2-image-compress
ng2-image-compress service is used to compress jpeg or png files on client side browser. It uses using HTML5 Canvas & File API. The compression algorithm is based on libraries angular-image-compress, ng-image-compress and J-I-C project on github.
Installation
To install this library, run:
$ npm install ng2-image-compress --save
Consuming ng2-image-compress library
You can import ng2-image-compress in your Angular application by running:
$ npm install ng2-image-compress
and then from your Angular AppModule
:
;; ; // Import your library;
Once your library is imported, you can use its components, directives in your Angular application:
<!-- Example app.component.html --><!-- <h2>Here are some links to help you start: </h2> <input id="testid" type="file" accept="image/*" multiple ng2-image-compress /> --> Original Image List Compressed Image List
;; ## License MIT ©