mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +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
Notes:
sideshowbarker
2024-07-17 01:46:00 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/8c1a409263 Pull-request: https://github.com/SerenityOS/serenity/pull/17627 Reviewed-by: https://github.com/nico ✅
|
@ -101,6 +101,17 @@ TEST_CASE(test_jpeg_sof0_one_scan)
|
||||||
EXPECT(frame.duration == 0);
|
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)
|
TEST_CASE(test_pbm)
|
||||||
{
|
{
|
||||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("buggie-raw.pbm"sv)));
|
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