mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 09:36:08 +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
Notes:
sideshowbarker
2024-07-17 11:06:06 +09:00
Author: https://github.com/LucasChollet
Commit: 62290d57f7
Pull-request: https://github.com/SerenityOS/serenity/pull/17907
Issue: https://github.com/SerenityOS/serenity/issues/4039
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/nico ✅
Reviewed-by: https://github.com/trflynn89 ✅
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)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue