mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 10:19:20 +00:00
LibGfx: Fix incorrect colors in ICO-embedded BMPs
This commit is contained in:
parent
9bae24cc4a
commit
e0ceb66580
Notes:
github-actions[bot]
2025-04-24 12:47:55 +00:00
Author: https://github.com/aplefull
Commit: e0ceb66580
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4447
Reviewed-by: https://github.com/AtkinsSJ ✅
3 changed files with 22 additions and 5 deletions
|
@ -192,6 +192,17 @@ TEST_CASE(test_bmp_embedded_in_ico)
|
|||
EXPECT_EQ(frame.image->get_pixel(7, 4), Gfx::Color(161, 0, 0));
|
||||
}
|
||||
|
||||
TEST_CASE(test_24bit_bmp_embedded_in_ico)
|
||||
{
|
||||
auto file = TRY_OR_FAIL(Core::MappedFile::map(TEST_INPUT("ico/yt-favicon.ico"sv)));
|
||||
EXPECT(Gfx::ICOImageDecoderPlugin::sniff(file->bytes()));
|
||||
auto plugin_decoder = TRY_OR_FAIL(Gfx::ICOImageDecoderPlugin::create(file->bytes()));
|
||||
|
||||
auto frame = TRY_OR_FAIL(expect_single_frame_of_size(*plugin_decoder, { 16, 16 }));
|
||||
EXPECT_EQ(frame.image->get_pixel(14, 14), Gfx::Color(234, 0, 0));
|
||||
EXPECT_EQ(frame.image->get_pixel(13, 15), Gfx::Color(255, 10, 15));
|
||||
}
|
||||
|
||||
TEST_CASE(test_malformed_maskless_ico)
|
||||
{
|
||||
auto file = TRY_OR_FAIL(Core::MappedFile::map(TEST_INPUT("ico/malformed_maskless.ico"sv)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue