mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibGfx/JBIG2: Reject unimplemented combination operators
In practice, everything uses white backgrounds and operators `or` or `xor` to turn them black, at least for the simple images we're about to be able to decode. To make sure we don't forget implementing this for real once needed, reject other ops, and also reject black backgrounds (because 1 | 0 is 1, not 0 like our overwrite implementation will produce). This means we have to remove a test, but since this scenario doesn't seem to happen in practice, that seems ok.
This commit is contained in:
@@ -325,17 +325,6 @@ TEST_CASE(test_jbig2_size)
|
||||
EXPECT_EQ(plugin_decoder->size(), Gfx::IntSize(399, 400));
|
||||
}
|
||||
|
||||
TEST_CASE(test_jbig2_black_47x23)
|
||||
{
|
||||
auto file = TRY_OR_FAIL(Core::MappedFile::map(TEST_INPUT("jbig2/black_47x23.jbig2"sv)));
|
||||
EXPECT(Gfx::JBIG2ImageDecoderPlugin::sniff(file->bytes()));
|
||||
auto plugin_decoder = TRY_OR_FAIL(Gfx::JBIG2ImageDecoderPlugin::create(file->bytes()));
|
||||
|
||||
auto frame = TRY_OR_FAIL(expect_single_frame_of_size(*plugin_decoder, { 47, 23 }));
|
||||
for (auto pixel : *frame.image)
|
||||
EXPECT_EQ(pixel, Gfx::Color(Gfx::Color::Black).value());
|
||||
}
|
||||
|
||||
TEST_CASE(test_jbig2_white_47x23)
|
||||
{
|
||||
auto file = TRY_OR_FAIL(Core::MappedFile::map(TEST_INPUT("jbig2/white_47x23.jbig2"sv)));
|
||||
|
||||
Reference in New Issue
Block a user