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

Support for embedded image decoding #9

Open
WhoseTheNerd opened this issue Jan 7, 2023 · 7 comments
Open

Support for embedded image decoding #9

WhoseTheNerd opened this issue Jan 7, 2023 · 7 comments

Comments

@WhoseTheNerd
Copy link

Decoding support for base64 embedded jpeg xl images would be nice. Any plans for that?

@WhoseTheNerd
Copy link
Author

WhoseTheNerd commented Jan 7, 2023

I managed to do this by adding el.src.startsWith("data:image/jpegxl;base64,") to the MutationObserver if list and all jxlSrc used in caching context gets encodeURIComponent(jxlSrc)

Resulting jxl.js looks like this

@niutech
Copy link
Owner

niutech commented Jan 7, 2023

Thanks, but what's the real world use case for this?

@WhoseTheNerd
Copy link
Author

It allows me not to deal with image files, since they are all embedded into single file, i.e. all images, js, css and etc. You can think of it as something similar to SingleFile.

@niutech
Copy link
Owner

niutech commented Jan 8, 2023

The MIME type image/jpegxl is still not standardized by IANA. There is a feature request for another MIME type image/jxl, so we cannot reliably use this one or another to detect JPEG XL images. It' the best to wait until it gets standardized.

@redthing1
Copy link

How to do this with blob image data?

@niutech
Copy link
Owner

niutech commented Apr 28, 2023

@redthing1 See #9 (comment)

@QINGCHARLES
Copy link

The MIME type image/jpegxl is still not standardized by IANA. There is a feature request for another MIME type image/jxl, so we cannot reliably use this one or another to detect JPEG XL images. It' the best to wait until it gets standardized.

It would be fine to check for either MIME type as there are no conflicts with other types.

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

4 participants