Skip to content

Instantly share code, notes, and snippets.

@tang3w
Created May 29, 2014 10:31
Show Gist options
  • Save tang3w/04f8d334764886f4ff63 to your computer and use it in GitHub Desktop.
Save tang3w/04f8d334764886f4ff63 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var fs = require('fs');
var gm = require('gm');
var argv = require('optimist')
.demand(1)
.demand('l')
.alias('l', 'label')
.describe('l', 'Specify a label')
.argv;
var file = argv._[0];
var label = argv['label'];
var stream = fs.createReadStream(file);
var magic = gm(stream);
magic.drawText(40, 30, label).write('./defaults.png', function (err) {
if (!err) console.log('Done!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment