node.js - Using multer in memory buffer with GraphicsMagick -
i'm trying resize image uploaded in memory, using multer on express file. while can access req.files.picture.buffer , shows content, when pass buffer gm receive enoent. code follows:
var buffer = req.files.picture.buffer gm(buffer) .options({imagemagick: true}) .resize(300) .tobuffer('png', function (err, buffer) { if (err) return handle(err); console.log('done!'); }); return res.sendstatus(200);
either using tobuffer
or write
output same enoent. missing something?
according gm
buffer example, need supply filename data. example: gm(buffer, 'foo.jpg')
Comments
Post a Comment