hi
Is that possible to get Buffer of converted Image.I've tried it but it return null
let ImageURI = req.body.data.thumbnailBlob;
let buf = new Buffer(ImageURI.replace(/^data:image\/\w+;base64,/, ""),'base64');
Jimp.read(buf,(err,image) => {
if(err) {
console.log(err)
}
image.cover(250,250)
.getBuffer( "image/jpeg",(Buff) => {
console.log(Buff)//null
})
})
@githubitsme Same issue here, how did you managed to overcome this situation?
Edit:
Since I always work with promises, I forgot to include in the callback parameters error and result:
image.getBuffer(Jimp.MIME_PNG, (error, result) => ...
the null is because no erro was found.
Hope help some absent minded like me :)
The code of write can help in this situation:
https://github.com/oliver-moran/jimp/blob/7fe1d467417b995939019bc5f4fdb919741e9113/packages/core/src/index.js#L507
Most helpful comment
@githubitsme Same issue here, how did you managed to overcome this situation?
Edit:
Since I always work with promises, I forgot to include in the callback parameters error and result:
the null is because no erro was found.
Hope help some absent minded like me :)