mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-24 03:25:02 +00:00
Tests/LibGfx: Add a test for the TIFF decoder
This commit is contained in:
parent
75caccafa4
commit
404093a42e
|
@ -20,6 +20,7 @@
|
|||
#include <LibGfx/ImageFormats/PNGLoader.h>
|
||||
#include <LibGfx/ImageFormats/PPMLoader.h>
|
||||
#include <LibGfx/ImageFormats/TGALoader.h>
|
||||
#include <LibGfx/ImageFormats/TIFFLoader.h>
|
||||
#include <LibGfx/ImageFormats/TinyVGLoader.h>
|
||||
#include <LibGfx/ImageFormats/WebPLoader.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
|
@ -369,6 +370,18 @@ TEST_CASE(test_targa_top_left_compressed)
|
|||
expect_single_frame(*plugin_decoder);
|
||||
}
|
||||
|
||||
TEST_CASE(test_tiff_uncompressed)
|
||||
{
|
||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("uncompressed.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/uncompressed.tiff
Normal file
BIN
Tests/LibGfx/test-inputs/uncompressed.tiff
Normal file
Binary file not shown.
Loading…
Reference in a new issue