Skip to content

Instantly share code, notes, and snippets.

@pavelpower
Created October 7, 2014 09:04
Show Gist options
  • Save pavelpower/d4ecd430e4594e6872b7 to your computer and use it in GitHub Desktop.
Save pavelpower/d4ecd430e4594e6872b7 to your computer and use it in GitHub Desktop.
function resize (cb) {
if (index === images.length) {
cb();
return;
}
var img = images[index++];
gm(img).resize(70, 70)
.borderColor('transparent')
.border(2, 2)
.noProfile()
.write(path.join(pathTmp, path.basename(img)), function () {
gm(img).resize(70, 70)
.borderColor('transparent')
.border(2, 2)
.noProfile()
.contrast(2)
.colorspace('GRAY')
.write(path.join(pathTmp, '_' + path.basename(img)), resize.bind(null, cb));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment