It handles properly when Jimp receives a Uint8array buffer.
Since puppeteer@23, Uint8Array is used instead of of Buffer. This is the default way for serializing a screenshot or pdf:
const buffer = await page.screenshot(opts) // this is a Uint8array now!
I noted Jimp was already handling arrayBuffer → buffer mainly targeting browsers, but now that Node.js is trying to move away from buffer I extended the original implementation to handle these case in Nodeland too.
Additionally, could be nice if Jimp supports native Uint8array manipulation so it doesn't need to turn it into Buffer.
What's Changing and Why
It handles properly when Jimp receives a Uint8array buffer.
Since puppeteer@23, Uint8Array is used instead of of Buffer. This is the default way for serializing a screenshot or pdf:
I noted Jimp was already handling arrayBuffer → buffer mainly targeting browsers, but now that Node.js is trying to move away from buffer I extended the original implementation to handle these case in Nodeland too.
Additionally, could be nice if Jimp supports native Uint8array manipulation so it doesn't need to turn it into Buffer.
What else might be affected
Nothing else!
Tasks
jimp.d.ts
(nothing to do)