0.0.2 • Published 5 years ago

@georgedrpg/bulk-image-resizer v0.0.2

Weekly downloads
2
License
ISC
Repository
-
Last release
5 years ago

WARNING: this script writes files on your hard drive, make sure it won't overwrite important images. Make sure outputPath is correct.

I suggest just use inputs/ as inputFolder and running the script with inputs/ in the same folder, and outputFolder to be in the same root as inputFolder.

Bulk image resize

Install as npm module ( to be set)

npm i <package-name>

Import into your project

import resizeImages from '<package-name>'

Call with these arguments (or use defaults)

inputPath (default: 'inputs') outputPath (default: 'outputs') targetWidth (default: 256) transformFilenameFn (default: (filename, width) => filename+`-${width}w`)

For example:

const width = 600;
resizeImages({ inputPath: 'public/images', outputPath: 'build/public/images_'+width, targetWidth: width })

TODO:

  • Needs automated tests

  • Need to make sure paths resolve correctly and odd input/output paths don't break

0.0.2

5 years ago

0.0.1

5 years ago