mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:57:35 +00:00
LibGfx/TIFF: Add support for images with PackBits compression
This commit is contained in:
parent
ed8d82f3de
commit
81794df280
3 changed files with 55 additions and 1 deletions
|
@ -382,6 +382,18 @@ TEST_CASE(test_tiff_uncompressed)
|
|||
EXPECT_EQ(frame.image->get_pixel(60, 75), Gfx::Color::NamedColor::Red);
|
||||
}
|
||||
|
||||
TEST_CASE(test_tiff_packed_bits)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("tiff/packed_bits.tiff"sv)));
|
||||
EXPECT(Gfx::TIFFImageDecoderPlugin::sniff(file->bytes()));
|
||||
auto plugin_decoder = MUST(Gfx::TIFFImageDecoderPlugin::create(file->bytes()));
|
||||
|
||||
auto frame = expect_single_frame_of_size(*plugin_decoder, { 400, 300 });
|
||||
|
||||
EXPECT_EQ(frame.image->get_pixel(0, 0), Gfx::Color::NamedColor::White);
|
||||
EXPECT_EQ(frame.image->get_pixel(60, 75), Gfx::Color::NamedColor::Red);
|
||||
}
|
||||
|
||||
TEST_CASE(test_webp_simple_lossy)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/simple-vp8.webp"sv)));
|
||||
|
|
BIN
Tests/LibGfx/test-inputs/tiff/packed_bits.tiff
Normal file
BIN
Tests/LibGfx/test-inputs/tiff/packed_bits.tiff
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue