DEV Community

Ashish Mehra
Ashish Mehra

Posted on

Image upload via buffer

I'm using buffer in Node.js for image upload in cloudinary but cloudinary doesn't have any option for image transformation for buffer upload.

Is there is any package which have the ability to resize image by reading buffer and return buffer back after resizing it.

Top comments (5)

Collapse
 
mfahlandt profile image
Mario •

I use sharp for all imagetransformation in nodeJS before uploading them to any cloud based service. It works great and the ressources you need are very low

Collapse
 
mehraas profile image
Ashish Mehra •

It is possible to implement something like this

sharp(inputBuffer)
  .resize(320, 240)
  .toBuffer()
Collapse
 
mfahlandt profile image
Mario •

yes :)

Thread Thread
 
mehraas profile image
Ashish Mehra •

thanks :-)

Collapse
 
diegoiscof profile image
Diego Iscof •

Hi! Do you have a similar resource for transform videos? Thnxs