Created
January 29, 2013 18:08
-
-
Save nathanbowser/4666257 to your computer and use it in GitHub Desktop.
This file contains 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
module.exports.thumb = function (buffer) { | |
var full = new Buffer(buffer, 'base64') // Convert base64 encoded value into binary | |
, thumbStream = new stream.Stream() // Create a new writable stream | |
im(full).thumb(800, 450, 100, 'topLeft', function (err, stdout, stderr) { | |
var writeStream = fs.createWriteStream('n.jpg') | |
stdout.pipe(thumbStream) | |
}) | |
return thumbStream | |
} | |
// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment