1.5.1 • Published 7 years ago

img-jar v1.5.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

img-jar

An embeed java image processor to crop and create resized images. You can access the Java code here.

Installation

$ npm i -S img-jar

Usage

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

License

MIT

1.5.1

7 years ago

1.5.0

7 years ago

1.4.1

7 years ago

1.3.0

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.1-0

8 years ago

1.0.0

8 years ago