Просмотр исходного кода

WebP/Lossy: Use correct test image for coefficient skipping

I somehow added the wrong image here. 4.webp is the one described
by the comment in the test. Now test actually uses the image it
claims to use.

No behavior change.
Nico Weber 2 лет назад
Родитель
Сommit
d1d9d7a4f3
3 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      Tests/LibGfx/TestImageDecoder.cpp
  2. BIN
      Tests/LibGfx/test-inputs/4.webp
  3. BIN
      Tests/LibGfx/test-inputs/5.webp

+ 5 - 5
Tests/LibGfx/TestImageDecoder.cpp

@@ -404,13 +404,13 @@ TEST_CASE(test_webp_extended_lossy_uncompressed_alpha)
     EXPECT_EQ(frame.image->get_pixel(355, 106), Gfx::Color(0, 0, 0, 0));
     EXPECT_EQ(frame.image->get_pixel(355, 106), Gfx::Color(0, 0, 0, 0));
 }
 }
 
 
-TEST_CASE(test_webp_lossy_5)
+TEST_CASE(test_webp_lossy_4)
 {
 {
     // This is https://commons.wikimedia.org/wiki/File:Fr%C3%BChling_bl%C3%BChender_Kirschenbaum.jpg,
     // This is https://commons.wikimedia.org/wiki/File:Fr%C3%BChling_bl%C3%BChender_Kirschenbaum.jpg,
     // under the Creative Commons Attribution-Share Alike 3.0 Unported license. The image was re-encoded
     // under the Creative Commons Attribution-Share Alike 3.0 Unported license. The image was re-encoded
     // as webp at https://developers.google.com/speed/webp/gallery1 and the webp version is from there.
     // as webp at https://developers.google.com/speed/webp/gallery1 and the webp version is from there.
     // No other changes have been made.
     // No other changes have been made.
-    auto file = MUST(Core::MappedFile::map(TEST_INPUT("5.webp"sv)));
+    auto file = MUST(Core::MappedFile::map(TEST_INPUT("4.webp"sv)));
     EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes()));
     EXPECT(Gfx::WebPImageDecoderPlugin::sniff(file->bytes()));
     auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes()));
     auto plugin_decoder = MUST(Gfx::WebPImageDecoderPlugin::create(file->bytes()));
     MUST(plugin_decoder->initialize());
     MUST(plugin_decoder->initialize());
@@ -419,13 +419,13 @@ TEST_CASE(test_webp_lossy_5)
     EXPECT(!plugin_decoder->is_animated());
     EXPECT(!plugin_decoder->is_animated());
     EXPECT(!plugin_decoder->loop_count());
     EXPECT(!plugin_decoder->loop_count());
 
 
-    EXPECT_EQ(plugin_decoder->size(), Gfx::IntSize(1024, 752));
+    EXPECT_EQ(plugin_decoder->size(), Gfx::IntSize(1024, 772));
 
 
     auto frame = MUST(plugin_decoder->frame(0));
     auto frame = MUST(plugin_decoder->frame(0));
-    EXPECT_EQ(frame.image->size(), Gfx::IntSize(1024, 752));
+    EXPECT_EQ(frame.image->size(), Gfx::IntSize(1024, 772));
 
 
     // This image tests macroblocks that have `skip_coefficients` set to true, and it test a boolean entropy decoder edge case.
     // This image tests macroblocks that have `skip_coefficients` set to true, and it test a boolean entropy decoder edge case.
-    EXPECT_EQ(frame.image->get_pixel(923, 576), Gfx::Color(0xab, 0x40, 0x14, 255));
+    EXPECT_EQ(frame.image->get_pixel(780, 570), Gfx::Color(0x72, 0xc8, 0xf6, 255));
 }
 }
 
 
 TEST_CASE(test_webp_extended_lossless)
 TEST_CASE(test_webp_extended_lossless)

BIN
Tests/LibGfx/test-inputs/4.webp


BIN
Tests/LibGfx/test-inputs/5.webp