commit | ca1fb3c7115db12ad2cd6af4cd36db8f38bfc2e9 | [log] [tgz] |
---|---|---|
author | Yannis Guyon <yguyon@google.com> | Tue Nov 23 16:14:15 2021 +0100 |
committer | Yannis Guyon <yguyon@google.com> | Tue Nov 23 16:14:15 2021 +0100 |
tree | b2736d011e57d7db135c18381a282ceb03c35234 | |
parent | f292c19e4bb51ce450997a8848fe545a5533c018 [diff] |
Abort after reading 32 sub-items To avoid timeouts, more than 32 brands, entries etc. is deemed unreasonable and kAvifInfoTooComplex is returned instead. 32 is arbitrary. Change-Id: I9c9b6961237c6d123a2bd1068e0c7d7a4093d6f0
libavifinfo is a standalone library that can be used to extract the width, height, bit depth and number of channels from an AVIF payload.
See avifinfo.h
for details on the API and avifinfo.c
for the implementation. See avifinfo_test.cc
for usage examples.
libavifinfo can be used when only a few AVIF features are needed and when linking to or including libavif is not an option. For decoding an image or extracting more features, please rely on libavif.
AvifInfoFeatures features; if (AvifInfoGet(bytes, number_of_available_bytes, &features) == kAvifInfoOk) { // Use 'features.width' etc. }
Note: AvifInfoGet()
is designed to return the same avifImage
field values as avifDecoderRead()
. However libavifinfo is more permissive and may return features of images considered invalid by libavif.
avifinfo.c
is written in C. To build from this directory:
mkdir build && \ cd build && \ cmake .. && \ cmake --build . --config Release
Tests are written in C++. GoogleTest is required.
mkdir build && \ cd build && \ cmake .. -DAVIFINFO_BUILD_TESTS=ON && \ cmake --build . --config Debug && \ ctest .
Google C/C++ Style Guide is used in this project.
If you would like to contribute to libavifinfo, please follow the steps for libaom at https://aomedia.googlesource.com/aom/#submitting-patches.
Bug reports can be filed in the Alliance for Open Media issue tracker.