Skip to content

Commit

Permalink
Add animated webp test image that is not decoding properly and a unit…
Browse files Browse the repository at this point in the history
… test.
  • Loading branch information
bluescan committed Sep 28, 2024
1 parent f351820 commit 90da5bf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions UnitTests/Src/TestImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ tTestUnit(ImageLoad)
tImageTIFF imgTIFF("TestData/Images/Tiff_NoComp.tif");
tRequire(imgTIFF.IsValid());

tImageWEBP imgWEBP("TestData/Images/RockyBeach.webp");
tImageWEBP imgWEBP("TestData/Images/WEBP/RockyBeach.webp");
tRequire(imgWEBP.IsValid());
}

Expand Down Expand Up @@ -443,7 +443,7 @@ tTestUnit(ImagePicture)
tRequire( tSystem::tFileExists("WrittenTiff_ZIP.tif"));

tImageWEBP webp;
webp.Load("RockyBeach.webp");
webp.Load("WEBP/RockyBeach.webp");
webp.Save("WrittenRockyBeach.webp");
pic.Set(webp); tga.Set(pic);
tga.Save("WrittenRockyBeach.tga");
Expand Down Expand Up @@ -1296,6 +1296,12 @@ tTestUnit(ImageMultiFrame)
tiffDst1.Save("TestData/Images/Demux_Confused.tiff");
tRequire(tSystem::tFileExists("TestData/Images/WrittenDemux_Confused.tiff"));
return;

// Test loading an animated webp and saving as multpage tiff.
tImageWEBP webpSrc("TestData/Images/WEBP/AnimatedTest.webp");
tImageTIFF tiffDst2(webpSrc.Frames, true);
tiffDst2.Save("TestData/Images/WrittenAnimatedTestManyFrames.tiff");
tRequire(tSystem::tFileExists("TestData/Images/WrittenAnimatedTestManyFrames.tiff"));
#endif

tImageTIFF tif;
Expand Down
4 changes: 2 additions & 2 deletions UnitTests/Src/UnitTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ int main(int argc, char** argv)
// tTest(ImageLoad);
// tTest(ImageSave);
// tTest(ImageTexture);
// tTest(ImageMultiFrame);
tTest(ImagePicture);
tTest(ImageMultiFrame);
// tTest(ImagePicture);
// tTest(ImageQuantize);
// tTest(ImagePalette);
// tTest(ImageFilter);
Expand Down
Binary file added UnitTests/TestData/Images/WEBP/AnimatedTest.webp
Binary file not shown.
File renamed without changes.

0 comments on commit 90da5bf

Please sign in to comment.