1.0.2 • Published 3 years ago
batch_image_processor v1.0.2
BATCH IMAGE PROCESSOR
Utility to process batches of images. In this first version we implement a single method "generateThumbnails" (in future versions the set of tools will be expanded).
How to install
npm i batch_image_processor
Methods
generateThumbnails
Method with four parameters: { A path to read list of files, path to save the thumbnails generated, width, height }
generateTumbnails(pathToRead[String], pathToSave[String], with[number], height[number])
Example of use:
- Without destructuring:
const imageProcessor = require('batchImageProcessor')
const pathToRead = path.join(__dirname + '/images/')
const pathToSave = path.join(__dirname + '/images/thumbnails/')
imageProcessor.generateThumbnails({
pathToRead,
pathToSave,
width : 300
height: 350
})
- With destructuring:
const {generateThumbnails} = require('batchImageProcessor')
const pathToRead = path.join(__dirname + '/images/')
const pathToSave = path.join(__dirname + '/images/thumbnails/')
generateThumbnails({
pathToRead,
pathToSave,
width : 300
})
In future versions, control of image extensions and other improvements will be added.