Tests: Add a test for SOF2 images with only spectral selection
You can generate one by using `cjpeg` with the -scan argument. This image has been generated with the following scan file: 0 1 2: 0 0 0 0; 0: 1 9 0 0; 2: 1 63 0 0 ; 1: 1 63 0 0 ; 0: 10 63 0 0;
This commit is contained in:
parent
89e8f4692d
commit
68cd6f5614
Notes:
sideshowbarker
2024-07-17 03:59:29 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/68cd6f5614 Pull-request: https://github.com/SerenityOS/serenity/pull/17652 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/nico ✅
2 changed files with 11 additions and 0 deletions
|
@ -112,6 +112,17 @@ TEST_CASE(test_jpeg_sof0_several_scans)
|
|||
EXPECT_EQ(frame.image->size(), Gfx::IntSize(720, 859));
|
||||
}
|
||||
|
||||
TEST_CASE(test_jpeg_sof2_spectral_selection)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("spectral_selection.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(592, 800));
|
||||
}
|
||||
|
||||
TEST_CASE(test_pbm)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("buggie-raw.pbm"sv)));
|
||||
|
|
BIN
Tests/LibGfx/test-inputs/spectral_selection.jpg
Normal file
BIN
Tests/LibGfx/test-inputs/spectral_selection.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
Loading…
Add table
Reference in a new issue