1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:57:45 +00:00

Tests: Add a test for JPEGs with RGB components

This commit is contained in:
Lucas CHOLLET 2023-03-04 22:05:02 -05:00 committed by Andreas Kling
parent a47d775be6
commit af58f012be
2 changed files with 11 additions and 0 deletions

View file

@ -112,6 +112,17 @@ TEST_CASE(test_jpeg_sof0_several_scans)
EXPECT_EQ(frame.image->size(), Gfx::IntSize(592, 800)); EXPECT_EQ(frame.image->size(), Gfx::IntSize(592, 800));
} }
TEST_CASE(test_jpeg_rgb_components)
{
auto file = MUST(Core::MappedFile::map(TEST_INPUT("rgb_components.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_jpeg_sof2_spectral_selection) TEST_CASE(test_jpeg_sof2_spectral_selection)
{ {
auto file = MUST(Core::MappedFile::map(TEST_INPUT("spectral_selection.jpg"sv))); auto file = MUST(Core::MappedFile::map(TEST_INPUT("spectral_selection.jpg"sv)));

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB