Good day, I am trying to resize an image, currently 300x300 pixels down to 100x100...
sharp(bufferResponse)
.resize(100, 100)
.toBuffer((err, data, info) => {
// handle resized response
});
I am having difficulty finding a setting for "quality" in the API docs which could apply to the above snippet. I need to retain the highest quality possible. Could someone point me in the right direction please?
Appreciate any assistance, Thanks in advance
Hello, if you're referring to the "quality" setting for JPEG output, please see the jpeg docs.
let bufferResponse = Buffer.concat(bufs);
sharp(bufferResponse)
.jpeg({ quality: 100, progressive: true })
.resize(100, 100)
.toBuffer((err, data, info) => {
// handle resized response
});
Issue resolved, thanks
Most helpful comment
let bufferResponse = Buffer.concat(bufs);
sharp(bufferResponse)
.jpeg({ quality: 100, progressive: true })
.resize(100, 100)
.toBuffer((err, data, info) => {
// handle resized response
});
Issue resolved, thanks