mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
Tests: Add a test for SOF0 images with several scans
This type of image isn't common, and you can probably only find one by generating it yourself. It can be done using `cjpeg` with the -scan argument. This image has been generated with the following scan file: 0: 0 63 0 0; 1: 0 63 0 0; 2: 0 63 0 0;
This commit is contained in:
parent
a40c7354c1
commit
8c1a409263
|
@ -101,6 +101,17 @@ TEST_CASE(test_jpeg_sof0_one_scan)
|
|||
EXPECT(frame.duration == 0);
|
||||
}
|
||||
|
||||
TEST_CASE(test_jpeg_sof0_several_scans)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("several_scans.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(720, 859));
|
||||
}
|
||||
|
||||
TEST_CASE(test_pbm)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("buggie-raw.pbm"sv)));
|
||||
|
|
BIN
Tests/LibGfx/test-inputs/several_scans.jpg
Normal file
BIN
Tests/LibGfx/test-inputs/several_scans.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
Loading…
Reference in a new issue