Skip to content

Instantly share code, notes, and snippets.

@spion
Created September 17, 2012 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spion/3740438 to your computer and use it in GitHub Desktop.
Save spion/3740438 to your computer and use it in GitHub Desktop.
var parallelResizes = 5;
async.mapSeries(files, function (item, cb) {
im.identify(source_dir + file, cb);
}, function (err, identifies) {
var queue = async.queue(function (options, callback) {
im.resize(options, callback);
}, parallelResizes);
identifiers.forEach(function (id) {
/* create options objects for every identifier-size pair and push each like this: */ queue.push(optionsSize1, optionsSize2,...);
});
queue.drain = function () {
console.log("resizing complete");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment