Skip to content

Commit

Permalink
Add colors-animated-8bpc-alpha-exif-xmp.avif test (#2116)
Browse files Browse the repository at this point in the history
  • Loading branch information
y-guyon authored Apr 16, 2024
1 parent 7cb941b commit 6a5ec63
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,15 @@ An animated AVIF image file with the following attributes:
* Repetition Count: 0
* Frame count: 5

### File [colors-animated-8bpc-alpha-exif-xmp.avif](colors-animated-8bpc-alpha-exif-xmp.avif)

![](colors-animated-8bpc-alpha-exif-xmp.avif)

License: [same as libavif](https://github.com/AOMediaCodec/libavif/blob/main/LICENSE)

Source: `colors-animated-8bpc.avif` but translucent and with the Exif/XMP chunks of
`paris_exif_xmp_icc.jpg`. The repetition is infinite.

# Other Test Files

### File [sRGB2014.icc](sRGB2014.icc)
Expand Down
Binary file not shown.
16 changes: 16 additions & 0 deletions tests/gtest/avifanimationtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ TEST(AvifDecodeTest, AnimatedImageWithSourceSetToPrimaryItem) {
EXPECT_NE(avifDecoderNextImage(decoder.get()), AVIF_RESULT_OK);
}

TEST(AvifDecodeTest, AnimatedImageWithAlphaAndMetadata) {
const char* file_name = "colors-animated-8bpc-alpha-exif-xmp.avif";
DecoderPtr decoder(avifDecoderCreate());
ASSERT_NE(decoder, nullptr);
ASSERT_EQ(avifDecoderSetIOFile(decoder.get(),
(std::string(data_path) + file_name).c_str()),
AVIF_RESULT_OK);
ASSERT_EQ(avifDecoderParse(decoder.get()), AVIF_RESULT_OK);
EXPECT_EQ(decoder->alphaPresent, AVIF_TRUE);
EXPECT_EQ(decoder->imageSequenceTrackPresent, AVIF_TRUE);
EXPECT_EQ(decoder->imageCount, 5);
EXPECT_EQ(decoder->repetitionCount, AVIF_REPETITION_COUNT_INFINITE);
EXPECT_EQ(decoder->image->exif.size, 1126);
EXPECT_EQ(decoder->image->xmp.size, 3898);
}

} // namespace
} // namespace avif

Expand Down

0 comments on commit 6a5ec63

Please sign in to comment.