1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 08:28:11 +00:00

LibGfx/ILBMLoader: Add support for PC DeluxePaint files

This commit is contained in:
Nicolas Ramz 2023-12-08 13:50:53 +01:00 committed by Sam Atkins
parent b108d51c5b
commit cd6c7f3fc4
6 changed files with 35 additions and 5 deletions

View file

@ -149,6 +149,17 @@ TEST_CASE(test_ilbm_ham6)
EXPECT_EQ(frame.image->get_pixel(77, 107), Gfx::Color(0xf0, 0x40, 0x40, 0xff));
}
TEST_CASE(test_ilbm_dos)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("ilbm/serenity.lbm"sv)));
EXPECT(Gfx::ILBMImageDecoderPlugin::sniff(file->bytes()));
auto plugin_decoder = TRY_OR_FAIL(Gfx::ILBMImageDecoderPlugin::create(file->bytes()));
auto frame = TRY_OR_FAIL(expect_single_frame_of_size(*plugin_decoder, { 640, 480 }));
EXPECT_EQ(frame.image->get_pixel(315, 134), Gfx::Color::NamedColor::Red);
}
TEST_CASE(test_ilbm_malformed_header)
{
Array test_inputs = {