Skip to content

Instantly share code, notes, and snippets.

@eczajk1
Created April 5, 2017 14:27
Show Gist options
  • Select an option

  • Save eczajk1/4d69b36e15adc7713eb90a0ba6e8ad75 to your computer and use it in GitHub Desktop.

Select an option

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
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