1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

Tests/LibGfx: Add a first test for JPEG XL images

This image uses the modular encoding with a very simple prediction tree.
It also makes use of two features: upsampling (x2 factor) and a
non-standard bit depth (10 bits). The file has been generated on
https://jxl-art.surma.technology/ , with the following input:

Width 64
Height 64
Upsample 2
Bitdepth 10

if N > 300
  - NE -6
  - W 6
This commit is contained in:
Lucas CHOLLET 2023-07-21 23:04:29 -04:00 committed by Tim Flynn
parent 9975bdb2d1
commit 89e2431517
2 changed files with 11 additions and 0 deletions

View file

@ -12,6 +12,7 @@
#include <LibGfx/ImageFormats/ICOLoader.h>
#include <LibGfx/ImageFormats/ImageDecoder.h>
#include <LibGfx/ImageFormats/JPEGLoader.h>
#include <LibGfx/ImageFormats/JPEGXLLoader.h>
#include <LibGfx/ImageFormats/PBMLoader.h>
#include <LibGfx/ImageFormats/PGMLoader.h>
#include <LibGfx/ImageFormats/PNGLoader.h>
@ -561,3 +562,13 @@ TEST_CASE(test_everything_tvg)
expect_single_frame_of_size(*plugin_decoder, { 400, 768 });
}
}
TEST_CASE(test_jxl_modular_simple_tree_upsample2_10bits)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("jxl/modular_simple_tree_upsample2_10bits.jxl"sv)));
EXPECT(Gfx::JPEGXLImageDecoderPlugin::sniff(file->bytes()));
auto plugin_decoder = MUST(Gfx::JPEGXLImageDecoderPlugin::create(file->bytes()));
expect_single_frame_of_size(*plugin_decoder, { 128, 128 });
}