Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/monkeymars/ng-image-compress

compress jpeg or png files using angularjs on client side - using HTML5 Canvas & File API (based off of a J-I-C project on github).
https://github.com/monkeymars/ng-image-compress

Last synced: 3 months ago
JSON representation

compress jpeg or png files using angularjs on client side - using HTML5 Canvas & File API (based off of a J-I-C project on github).

Awesome Lists containing this project

README

        

ng-image-compress
=================

######This Angular directive compresses jpeg or png files using angularjs on client side. It uses using HTML5 Canvas & File API. The compression algorithm is based off of the J-I-C project on github.
###### There's an old angularjs-imageupload-directive from mischi package that claims to do image compress, but somehow it doesn't compress images nearly as well as the J-I-C project's. Thus, this repo here. Some of the code was borrowed from the above too, so u will find similarities. Note: I have absolutely no clue why J-I-C's compression is better.
-----------

Steps:

1. bower install ng-image-compress then add ng-image-compress.js directive as a dependency in your index.html
2. add image tag to ur html element. eg. image="myAwesomeImage"
3. add to ur html page to see the compressed photo.
4. do whatever u want to do with the compressed file. eg. use angular-file-upload package to upload it.

Example:

``

**Adjustable: resize-max-height, resize-max-width, resize-quality, resize-type

For demo, u can just clone this repo and then run index.html. thanks!!