Open lpatiny opened 6 months ago
This can only work by default in the browser (ImageData doesn't exist in Node.js).
For the test case, a fake class could be added in a before
hook:
globalThis.ImageData = class ImageData {
// Minimal implementation for the test.
}
And deleted in an after
hook:
delete globalThis.ImageData;
API: https://developer.mozilla.org/en-US/docs/Web/API/ImageData/ImageData
Need to convert the image to RGBA and then get the raw data