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

Optional mimeType for ImageDecoder? #252

Closed
jakearchibald opened this issue May 21, 2021 · 3 comments
Closed

Optional mimeType for ImageDecoder? #252

jakearchibald opened this issue May 21, 2021 · 3 comments

Comments

@jakearchibald
Copy link

Right now, you need to provide a mimeType for ImageDecoder, but createImageBitmap uses sniffing.

Could the ImageDecoder mimetype be optional and use sniffing if one isn't provided?

@jakearchibald
Copy link
Author

Some more context: On squoosh.app we'd like to use ImageDecoder, particularly for animated file formats.

Right now <img> supports animated formats, even if the mime type is incorrect.

If we want to match the support of <img> where the file extension or mime type doesn't matter, but be able to grab particular frames from the animated format, we would need to implement our own sniffing, even though that code already exists in the browser.

@dalecurtis
Copy link
Contributor

This is a duplicate of #169 -- please add your discussion there.

@jakearchibald
Copy link
Author

Hah, sorry, I searched for "mimetype" but it doesn't appear in that issue

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

2 participants