diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2023-11-26 17:01:03 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2023-11-26 17:26:09 +0000 |
commit | f68aca93b7e9f5dd05f1e49ba8ae70ada3ef3d1f (patch) | |
tree | 1bd969fdff9af91937dfe3ecab2d5fc25819cf02 | |
parent | d59f30c683b9c65a3380a8276247141989359acb (diff) | |
download | netsurf-master.tar.gz netsurf-master.tar.bz2 |
-rw-r--r-- | content/handlers/image/jpegxl.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/content/handlers/image/jpegxl.c b/content/handlers/image/jpegxl.c index 0451e2a88..01c704577 100644 --- a/content/handlers/image/jpegxl.c +++ b/content/handlers/image/jpegxl.c @@ -97,6 +97,17 @@ jpegxl_cache_convert(struct content *c) const uint8_t *src_data; size_t src_size; uint8_t * output; + bitmap_fmt_t jxl_fmt = { + /** TODO: At the moment we have to set the layout to the only + * pixel layout that libjxl supports. It looks like they + * plan to add support for decoding to other layouts + * in the future, as shown by the TODO in the docs: + * + * https://libjxl.readthedocs.io/en/latest/api_common.html#_CPPv414JxlPixelFormat + */ + .layout = BITMAP_LAYOUT_R8G8B8A8, + .pma = bitmap_fmt.pma, + }; jxldec = JxlDecoderCreate(NULL); if (jxldec == NULL) { @@ -180,8 +191,9 @@ jpegxl_cache_convert(struct content *c) JxlDecoderDestroy(jxldec); + bitmap_format_to_client(bitmap, &jxl_fmt); guit->bitmap->modified(bitmap); - + return bitmap; } |