Fix #915: Unable to view JXL code streams
authorColin Clark <colin.clark@cclark.uk>
Thu, 12 Aug 2021 09:15:55 +0000 (10:15 +0100)
committerColin Clark <colin.clark@cclark.uk>
Thu, 12 Aug 2021 09:15:55 +0000 (10:15 +0100)
https://github.com/BestImageViewer/geeqie/issues/915

Use FF0A as an additional magic number for JPEG XL files.

src/image-load.c

index 74c3ca9..0b16457 100644 (file)
@@ -827,6 +827,13 @@ static void image_loader_setup_loader(ImageLoader *il)
                image_loader_backend_set_jpegxl(&il->backend);
                }
        else
+       if (il->bytes_total >= 2 &&
+               (memcmp(il->mapped_file, "\xFF\x0A", 2) == 0))
+               {
+               DEBUG_1("Using custom jpeg xl loader");
+               image_loader_backend_set_jpegxl(&il->backend);
+               }
+       else
 #endif
        if (il->fd->format_class == FORMAT_CLASS_COLLECTION)
                {