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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -