I am trying to pipe data from a stream into a child process.
var gm = spawn( \'gm convert - -thumbnail 220x165^ -gravity center -extent 220x165 thumb.jpg\' );
va
Example of how to stream a request into imagemagick:
var image = request.get(req.params.url);
var size = req.params.size.split('x');
var args = ['-', '-thumbnail', req.params.size + '^', '-gravity', 'center', '-extent', req.params.size, '-' ];
var convert = spawn('convert', args);
image.pipe(convert.stdin);
convert.stdout.pipe(res);
Great talk about this: http://vimeo.com/43380478
And the source code: https://github.com/felixge/rebel-resize