mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +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:
parent
312c398b59
commit
8da9ff24e4
3 changed files with 22 additions and 0 deletions
|
@ -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)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue