diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index 57d5270ad5..4ec10c932e 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -112,6 +112,17 @@ TEST_CASE(test_jpeg_sof0_several_scans) EXPECT_EQ(frame.image->size(), Gfx::IntSize(720, 859)); } +TEST_CASE(test_jpeg_sof2_spectral_selection) +{ + auto file = MUST(Core::MappedFile::map(TEST_INPUT("spectral_selection.jpg"sv))); + EXPECT(Gfx::JPEGImageDecoderPlugin::sniff(file->bytes())); + auto plugin_decoder = MUST(Gfx::JPEGImageDecoderPlugin::create(file->bytes())); + EXPECT(plugin_decoder->initialize()); + + auto frame = MUST(plugin_decoder->frame(0)); + EXPECT_EQ(frame.image->size(), Gfx::IntSize(592, 800)); +} + TEST_CASE(test_pbm) { auto file = MUST(Core::MappedFile::map(TEST_INPUT("buggie-raw.pbm"sv))); diff --git a/Tests/LibGfx/test-inputs/spectral_selection.jpg b/Tests/LibGfx/test-inputs/spectral_selection.jpg new file mode 100644 index 0000000000..4c77ca210a Binary files /dev/null and b/Tests/LibGfx/test-inputs/spectral_selection.jpg differ