mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
LibGfx: Support BMP favicons with less than 32 bpp
Adapt BMPImageDecoderPlugin to support BMP images included in ICOns. ICOImageDecoderPlugin now uses BMPImageDecoderPlugin to decode all BMP images instead of it's own ad-hoc decoder which only supported 32 bpp BMPs.
This commit is contained in:
parent
91609f9327
commit
7e9019a9c3
5 changed files with 192 additions and 158 deletions
|
@ -49,9 +49,8 @@ TEST_CASE(test_gif)
|
|||
EXPECT(frame.duration == 400);
|
||||
}
|
||||
|
||||
TEST_CASE(test_ico)
|
||||
TEST_CASE(test_not_ico)
|
||||
{
|
||||
// FIXME: Use an ico file
|
||||
auto file = Core::MappedFile::map("/res/graphics/buggie.png"sv).release_value();
|
||||
auto ico = Gfx::ICOImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(ico.frame_count());
|
||||
|
@ -63,6 +62,19 @@ TEST_CASE(test_ico)
|
|||
EXPECT(ico.frame(0).is_error());
|
||||
}
|
||||
|
||||
TEST_CASE(test_bmp_embedded_in_ico)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/icons/16x16/serenity.ico"sv).release_value();
|
||||
auto ico = Gfx::ICOImageDecoderPlugin((u8 const*)file->data(), file->size());
|
||||
EXPECT(ico.frame_count());
|
||||
|
||||
EXPECT(ico.sniff());
|
||||
EXPECT(!ico.is_animated());
|
||||
EXPECT(!ico.loop_count());
|
||||
|
||||
EXPECT(!ico.frame(0).is_error());
|
||||
}
|
||||
|
||||
TEST_CASE(test_jpg)
|
||||
{
|
||||
auto file = Core::MappedFile::map("/res/html/misc/bmpsuite_files/rgb24.jpg"sv).release_value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue