1

I want to upload file with multer and sharp;but resize not work with toBuffer.

here is my codes:

sharp(req.file.path)
                 .resize(20,20).toFormat('jpeg')
                 .toBuffer(function (err,info) {
})

But if i use with toFile works perfectly.like this:

 sharp(req.file.path)
                     .resize(20,20)
                     .toFile("ss.jpg",function (err,info) {
    })

0 Answers0