Created
April 5, 2017 14:27
-
-
Save eczajk1/4d69b36e15adc7713eb90a0ba6e8ad75 to your computer and use it in GitHub Desktop.
Resize photos in a folder, saving the new files in a subfolder. Requires ImageMagick 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var exec = require('child_process').exec; | |
| var fs = require('fs'); | |
| fs | |
| .readdirSync(__dirname) | |
| .filter(function (file) { | |
| return file.indexOf('.') > -1 && file != 'index.js'; | |
| }) | |
| .forEach(function(file) { | |
| exec('magick ' + file + ' -resize 640x640 ./out/' + file) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment