mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
Tests/LibGfx: Add a test for the TIFF decoder
This commit is contained in:
parent
75caccafa4
commit
404093a42e
2 changed files with 13 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
||||||
#include <LibGfx/ImageFormats/PNGLoader.h>
|
#include <LibGfx/ImageFormats/PNGLoader.h>
|
||||||
#include <LibGfx/ImageFormats/PPMLoader.h>
|
#include <LibGfx/ImageFormats/PPMLoader.h>
|
||||||
#include <LibGfx/ImageFormats/TGALoader.h>
|
#include <LibGfx/ImageFormats/TGALoader.h>
|
||||||
|
#include <LibGfx/ImageFormats/TIFFLoader.h>
|
||||||
#include <LibGfx/ImageFormats/TinyVGLoader.h>
|
#include <LibGfx/ImageFormats/TinyVGLoader.h>
|
||||||
#include <LibGfx/ImageFormats/WebPLoader.h>
|
#include <LibGfx/ImageFormats/WebPLoader.h>
|
||||||
#include <LibTest/TestCase.h>
|
#include <LibTest/TestCase.h>
|
||||||
|
@ -369,6 +370,18 @@ TEST_CASE(test_targa_top_left_compressed)
|
||||||
expect_single_frame(*plugin_decoder);
|
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)
|
TEST_CASE(test_webp_simple_lossy)
|
||||||
{
|
{
|
||||||
auto file = MUST(Core::MappedFile::map(TEST_INPUT("webp/simple-vp8.webp"sv)));
|
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…
Add table
Add a link
Reference in a new issue