From fa379b6e861071016a0a8e29d24c8e5f1ab14f71 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sat, 22 Jul 2023 13:20:48 -0400 Subject: [PATCH] Tests/LibGfx: Use a JPEG XL image with a RCT transformation This image is exactly the same as the previous one, excepted the RCT transformation. It has been generated with: Width 64 Height 64 RCT 29 Upsample 2 Bitdepth 10 if N > 300 - NE -6 - W 6 --- Tests/LibGfx/TestImageDecoder.cpp | 6 ++++-- .../jxl/modular_simple_tree_upsample2_10bits.jxl | Bin 26 -> 0 bytes .../modular_simple_tree_upsample2_10bits_rct.jxl | Bin 0 -> 27 bytes 3 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 Tests/LibGfx/test-inputs/jxl/modular_simple_tree_upsample2_10bits.jxl create mode 100644 Tests/LibGfx/test-inputs/jxl/modular_simple_tree_upsample2_10bits_rct.jxl diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index a668175280..e2e52751b6 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -565,10 +565,12 @@ TEST_CASE(test_everything_tvg) 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))); + auto file = MUST(Core::MappedFile::map(TEST_INPUT("jxl/modular_simple_tree_upsample2_10bits_rct.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 }); + + auto frame = MUST(plugin_decoder->frame(0)); + EXPECT_EQ(frame.image->get_pixel(42, 57), Gfx::Color::from_string("#4c0072"sv)); } diff --git a/Tests/LibGfx/test-inputs/jxl/modular_simple_tree_upsample2_10bits.jxl b/Tests/LibGfx/test-inputs/jxl/modular_simple_tree_upsample2_10bits.jxl deleted file mode 100644 index 291b1385fe63332d10fc1cbd71e506abbfa6a983..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26 hcmey*6(69|!N$m7!{BX^)RWEs?)ako6CEmv3;=T52`&Ht diff --git a/Tests/LibGfx/test-inputs/jxl/modular_simple_tree_upsample2_10bits_rct.jxl b/Tests/LibGfx/test-inputs/jxl/modular_simple_tree_upsample2_10bits_rct.jxl new file mode 100644 index 0000000000000000000000000000000000000000..79239e6400dd3bca6f3d2944c91b475b00cdae0c GIT binary patch literal 27 icmey*6(69|!N$noz~F6>)RWEs?)ako6CElK8QcMW7zz0R literal 0 HcmV?d00001