mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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
Notes:
sideshowbarker
2024-07-17 05:00:08 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/8da9ff24e4 Pull-request: https://github.com/SerenityOS/serenity/pull/18716 Issue: https://github.com/SerenityOS/serenity/issues/18720 Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/nico ✅
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)));
|
||||
|
|
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 |
Loading…
Reference in a new issue