Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getImageData #430

Open
lpatiny opened this issue Feb 8, 2024 · 1 comment
Open

getImageData #430

lpatiny opened this issue Feb 8, 2024 · 1 comment
Assignees

Comments

@lpatiny
Copy link
Member

lpatiny commented Feb 8, 2024

Need to convert the image to RGBA and then get the raw data

image

@targos
Copy link
Member

targos commented Feb 8, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants