samedi 7 mars 2015

Request image and encode to raw pixel buffer in Node

I'd like to manipulate an image in Node and push it to S3 without having to save it locally.


I'm using the lwip module right now, which accepts "raw pixel" buffers. My code for getting a buffer is like this.



request.get( { url: imageUrl, setEncoding: null }, function ( err, response, body ) {
if ( err )
reject( new Error( err ) )

image.buffer = body

resolve( image )
})


But this doesn't seem to be accepted. Is there a way to get this raw pixel data, or another module that supports this type of buffer?


Aucun commentaire:

Enregistrer un commentaire