0.0.3 • Published 10 years ago
imagery v0.0.3
Imagery
Convert multiple images async in node.js.
Usage
var imagery = require("imagery");
var options = {
destination: './library/test',
quality: 35,
scale: {
width: 100,
height: 100
},
resize: {
width: 100,
height: 100
},
compressType: 'JPEG',
fileType: 'gif'
};
var source = './library/images';
// options is optional
imagery(source, options, function(err, info, done) {
console.log(err, info, done);
if (done) {
return console.log('done');
}
});Info
sourceDefault: 'edited_images' directoryoptionsThe options object passed in. values:destinationDestination folder. Default: 'edited_images' directoryquality- Quality of the images. Default: 35scale- {width, height}resize- {width, height}compressType- None, BZip, Fax, Group4, JPEG, Lossless, LZW, RLE, Zip, or LZMA. Default: 'JPEG'fileType- Gif, Jpeg, Png, Tiff. Default: 'JPEG'
callbackCallback per file with following arguments: values:err- Error message per fileinfo- Additional info when file has been editeddone- Boolean when all files has been edited
# Install imagemagick
brew install imagemagick
# Install imagemagick on linux
sudo apt-get install imagemagick
# Install imagery
npm install imagery