Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raphaelbs/img-jar
An embeed java image processor to crop and resize images from NodeJS.
https://github.com/raphaelbs/img-jar
crop crop-images java nodejs-modules resize-images
Last synced: 2 days ago
JSON representation
An embeed java image processor to crop and resize images from NodeJS.
- Host: GitHub
- URL: https://github.com/raphaelbs/img-jar
- Owner: raphaelbs
- Created: 2016-08-16T21:36:13.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-17T18:55:08.000Z (over 7 years ago)
- Last Synced: 2024-10-08T21:36:18.061Z (about 1 month ago)
- Topics: crop, crop-images, java, nodejs-modules, resize-images
- Language: JavaScript
- Homepage:
- Size: 110 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# img-jar
An embeed java image processor to crop and create resized images.
You can access the Java code [here](https://github.com/raphaelbs/img-jar-java).### Installation
```sh
$ npm i -S img-jar
```### Usage
```javascript
var imgJar = require('img-jar');
var path = require('path');function callback(error, stdout, stderr){
if(error || stderr){
console.error('Erro:\n' + error || stderr);
}else{
console.log(stdout);
}
};// Crop only
imgJar(__dirname + '\\finding-dory-xlarge.jpg', // origin (path + filename + extension)
__dirname + '\\dory', // destination (path + filename)
960, // will be resized to this value if the bigger side > 1000px
{x : 180, y : 150, h : 300, w : 350}, // crop parameters
callback); //callback// Crop and resizes
imgJar(__dirname + '\\finding-dory-xlarge.jpg', // origin
__dirname + '\\dory', // destination,
680, // will be resized to this value if the bigger side > 1000px
{x : 180, y : 150, h : 300, w : 350}, // crop parameters
{small : 100, // resize the dory image to 100 pixels max (dory-small.jpg)
thumb : 150, // resize the dory image to 150 pixels max (dory-thumb.jpg)
half: 0.5}, // resize the dory image to half (dory-half.jpg)
callback); //callback
```# Contact-me
* [Email](mailto:[email protected])
* [Facebook](https://facebook.com/raphaelbs)
* [GitHub](https://github.com/raphaelbs)
* [NPM](https://npmjs.com/~ralpha)# License
MIT