Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leunardo/ng-jic
angular module for image compression based on J-I-C https://github.com/brunobar79/J-I-C
https://github.com/leunardo/ng-jic
angularjs image-compression
Last synced: about 1 month ago
JSON representation
angular module for image compression based on J-I-C https://github.com/brunobar79/J-I-C
- Host: GitHub
- URL: https://github.com/leunardo/ng-jic
- Owner: leunardo
- License: mit
- Created: 2017-07-20T04:23:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-21T03:11:27.000Z (over 7 years ago)
- Last Synced: 2024-11-20T11:19:36.930Z (about 2 months ago)
- Topics: angularjs, image-compression
- Language: JavaScript
- Size: 630 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ng-jic
angular module for image compression based on J-I-C https://github.com/brunobar79/J-I-C## How to install it?
* First load angular with cdn or local file.
* Then you can:
* NPM (outdated):
`npm intall ng-jic`
* CDN:
**minified**:
``
``
**development**:
````
## How to use it?
1. Add ng-Jic to your module:
`angular.module('example', ['ngJic'])`1. Add the service into your controller:
`app.controller('controller', function($scope, ngJic) {...}`1. `ngJic.compress(myImage, quality, outputFormat?)`
*? indicates optional*
**The accepted output formats currently are: `jpg` (converted to `jpeg` anyway), `jpeg` and `png` due to a limitation on canvas.** See [this](https://kangax.github.io/jstests/toDataUrl_mime_type_test/)
Note that `myImage` **must** be a HTMLImageElement in order to work. This will return you another HTMLImageElement that you can use it to render the image into the DOM or another amazing things you can do with [HTMLImageElement](https://developer.mozilla.org/en/docs/Web/API/HTMLImageElement).