mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:57:45 +00:00
Tests: Add a test for SOF2 JPEGs with successive approximations
This image was generated using `cjpeg` with the following scan file: 0 1 2: 0 0 0 2; 0: 1 63 0 1; 1: 1 63 0 1; 2: 1 63 0 1; 0 1 2: 0 0 2 1; 0: 1 63 1 0; 1: 1 63 1 0; 2: 1 63 1 0; 0 1 2: 0 0 1 0;
This commit is contained in:
parent
f42d850211
commit
62290d57f7
2 changed files with 11 additions and 0 deletions
|
@ -145,6 +145,17 @@ TEST_CASE(test_jpeg_sof0_several_scans_odd_number_mcu)
|
|||
EXPECT_EQ(frame.image->size(), Gfx::IntSize(600, 600));
|
||||
}
|
||||
|
||||
TEST_CASE(test_jpeg_sof2_successive_aproximation)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("successive_approximation.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(600, 800));
|
||||
}
|
||||
|
||||
TEST_CASE(test_pbm)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("buggie-raw.pbm"sv)));
|
||||
|
|
BIN
Tests/LibGfx/test-inputs/successive_approximation.jpg
Normal file
BIN
Tests/LibGfx/test-inputs/successive_approximation.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
Loading…
Add table
Add a link
Reference in a new issue