diff --git a/Base/res/html/misc/targasuite_files/buggie-bottom-left-compressed.tga b/Base/res/html/misc/targasuite_files/buggie-bottom-left-compressed.tga new file mode 100644 index 0000000000..187d49bec5 Binary files /dev/null and b/Base/res/html/misc/targasuite_files/buggie-bottom-left-compressed.tga differ diff --git a/Base/res/html/misc/targasuite_files/buggie-top-left-compressed.tga b/Base/res/html/misc/targasuite_files/buggie-top-left-compressed.tga new file mode 100644 index 0000000000..45cbda9521 Binary files /dev/null and b/Base/res/html/misc/targasuite_files/buggie-top-left-compressed.tga differ diff --git a/Tests/LibGfx/TestImageDecoder.cpp b/Tests/LibGfx/TestImageDecoder.cpp index f458a6f500..7c6ceb836a 100644 --- a/Tests/LibGfx/TestImageDecoder.cpp +++ b/Tests/LibGfx/TestImageDecoder.cpp @@ -176,3 +176,35 @@ TEST_CASE(test_targa_top_left) auto frame = frame_or_error.release_value(); EXPECT(frame.duration == 0); } + +TEST_CASE(test_targa_bottom_left_compressed) +{ + auto file = Core::MappedFile::map("/res/html/misc/targasuite_files/buggie-bottom-left-compressed.tga"sv).release_value(); + auto tga = Gfx::TGAImageDecoderPlugin(reinterpret_cast(file->data()), file->size()); + EXPECT_EQ(tga.frame_count(), 1u); + + EXPECT(tga.sniff()); + EXPECT(!tga.is_animated()); + EXPECT(!tga.loop_count()); + + auto frame_or_error = tga.frame(0); + EXPECT(!frame_or_error.is_error()); + auto frame = frame_or_error.release_value(); + EXPECT(frame.duration == 0); +} + +TEST_CASE(test_targa_top_left_compressed) +{ + auto file = Core::MappedFile::map("/res/html/misc/targasuite_files/buggie-top-left-compressed.tga"sv).release_value(); + auto tga = Gfx::TGAImageDecoderPlugin(reinterpret_cast(file->data()), file->size()); + EXPECT_EQ(tga.frame_count(), 1u); + + EXPECT(tga.sniff()); + EXPECT(!tga.is_animated()); + EXPECT(!tga.loop_count()); + + auto frame_or_error = tga.frame(0); + EXPECT(!frame_or_error.is_error()); + auto frame = frame_or_error.release_value(); + EXPECT(frame.duration == 0); +}