1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

Tests: Add a test for JPEGs with an empty ICC profile

No encoder should declare an ICC profile with a size of zero, but some
does. This image has one of these dummy declaration.
This commit is contained in:
Lucas CHOLLET 2023-07-05 11:08:35 -04:00 committed by Sam Atkins
parent 243e91f5de
commit 3d2e4ba482
2 changed files with 10 additions and 0 deletions

View file

@ -177,6 +177,16 @@ TEST_CASE(test_jpeg_sof2_12bits)
expect_single_frame_of_size(*plugin_decoder, { 320, 240 });
}
TEST_CASE(test_jpeg_empty_icc)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("jpg/gradient_empty_icc.jpg"sv)));
EXPECT(Gfx::JPEGImageDecoderPlugin::sniff(file->bytes()));
auto plugin_decoder = MUST(Gfx::JPEGImageDecoderPlugin::create(file->bytes()));
MUST(plugin_decoder->initialize());
expect_single_frame_of_size(*plugin_decoder, { 80, 80 });
}
TEST_CASE(test_pbm)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("pnm/buggie-raw.pbm"sv)));