mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
Tests/LibGfx: Add a test for the TIFF decoder
This commit is contained in:
parent
75caccafa4
commit
404093a42e
Notes:
sideshowbarker
2024-07-17 02:08:15 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/404093a42e Pull-request: https://github.com/SerenityOS/serenity/pull/21666 Reviewed-by: https://github.com/nico ✅ Reviewed-by: https://github.com/tcl3
@ -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 New Issue
Block a user