mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
Tests: Add tests for 12 bits JPEGs
In this commit, two tests are added, one with a `SOF1` image, the other with a `SOF2`.
This commit is contained in:
committed by
Andreas Kling
parent
312c398b59
commit
8da9ff24e4
@@ -156,6 +156,28 @@ TEST_CASE(test_jpeg_sof2_successive_aproximation)
|
||||
EXPECT_EQ(frame.image->size(), Gfx::IntSize(600, 800));
|
||||
}
|
||||
|
||||
TEST_CASE(test_jpeg_sof1_12bits)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("12-bit.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(320, 240));
|
||||
}
|
||||
|
||||
TEST_CASE(test_jpeg_sof2_12bits)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("12-bit-progressive.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(320, 240));
|
||||
}
|
||||
|
||||
TEST_CASE(test_pbm)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("buggie-raw.pbm"sv)));
|
||||
|
||||
BIN
Tests/LibGfx/test-inputs/12-bit-progressive.jpg
Normal file
BIN
Tests/LibGfx/test-inputs/12-bit-progressive.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
Tests/LibGfx/test-inputs/12-bit.jpg
Normal file
BIN
Tests/LibGfx/test-inputs/12-bit.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Reference in New Issue
Block a user