diff options
-rw-r--r-- | Tests/LibGfx/TestImageDecoder.cpp | 11 | ||||
-rw-r--r-- | Tests/LibGfx/test-inputs/successive_approximation.jpg | bin | 0 -> 11736 bytes |
2 files changed, 11 insertions, 0 deletions
diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index ce1ae607ca..564d0be3a0 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -145,6 +145,17 @@ TEST_CASE(test_jpeg_sof0_several_scans_odd_number_mcu) EXPECT_EQ(frame.image->size(), Gfx::IntSize(600, 600)); } +TEST_CASE(test_jpeg_sof2_successive_aproximation) +{ + auto file = MUST(Core::MappedFile::map(TEST_INPUT("successive_approximation.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(600, 800)); +} + TEST_CASE(test_pbm) { auto file = MUST(Core::MappedFile::map(TEST_INPUT("buggie-raw.pbm"sv))); diff --git a/Tests/LibGfx/test-inputs/successive_approximation.jpg b/Tests/LibGfx/test-inputs/successive_approximation.jpg Binary files differnew file mode 100644 index 0000000000..3818265f96 --- /dev/null +++ b/Tests/LibGfx/test-inputs/successive_approximation.jpg |