mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-10 11:36:22 +00:00
LibGfx: Use libjxl to decode JPEG XL images
It currently doesn't support animated image. Note that Gfx::Bitmap has no support for get_pixel when the format is RGBA8888. This is why it has been removed from the tests.
This commit is contained in:
parent
d417b75683
commit
1039561280
Notes:
github-actions[bot]
2024-07-22 07:16:05 +00:00
Author: https://github.com/LucasChollet
Commit: 1039561280
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/756
6 changed files with 124 additions and 2652 deletions
|
@ -986,27 +986,6 @@ TEST_CASE(test_jxl_modular_simple_tree_upsample2_10bits)
|
|||
TRY_OR_FAIL(expect_single_frame_of_size(*plugin_decoder, { 128, 128 }));
|
||||
|
||||
auto frame = TRY_OR_FAIL(plugin_decoder->frame(0));
|
||||
EXPECT_EQ(frame.image->get_pixel(42, 57), Gfx::Color::from_string("#4c0072"sv));
|
||||
}
|
||||
|
||||
TEST_CASE(test_jxl_modular_property_8)
|
||||
{
|
||||
auto file = TRY_OR_FAIL(Core::MappedFile::map(TEST_INPUT("jxl/modular_property_8.jxl"sv)));
|
||||
EXPECT(Gfx::JPEGXLImageDecoderPlugin::sniff(file->bytes()));
|
||||
auto plugin_decoder = TRY_OR_FAIL(Gfx::JPEGXLImageDecoderPlugin::create(file->bytes()));
|
||||
|
||||
TRY_OR_FAIL(expect_single_frame_of_size(*plugin_decoder, { 32, 32 }));
|
||||
|
||||
auto frame = TRY_OR_FAIL(plugin_decoder->frame(0));
|
||||
for (u8 i = 0; i < 32; ++i) {
|
||||
for (u8 j = 0; j < 32; ++j) {
|
||||
auto const color = frame.image->get_pixel(i, j);
|
||||
if ((i + j) % 2 == 0)
|
||||
EXPECT_EQ(color, Gfx::Color::Black);
|
||||
else
|
||||
EXPECT_EQ(color, Gfx::Color::Yellow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE(test_avif_simple_lossy)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue