commit | 5ed875e3df4f6bf6d0a96bd79fdb6515e0114f50 | [log] [tgz] |
---|---|---|
author | Yannis Guyon <yguyon@google.com> | Wed Nov 03 15:12:37 2021 +0100 |
committer | Yannis Guyon <yguyon@google.com> | Tue Nov 16 10:07:40 2021 +0100 |
tree | 9d13783cd8a33e1a0c1225433f01c4dc0cc5d19c | |
parent | 11b58281187f6bf9063cad2f60620a64695f2ec1 [diff] |
AVIF-info library and test libavifinfo is a standalone library that can be used to extract the width, height, bit depth and number of channels from an AVIF payload. It is small on purpose and made of avifinfo.h and avifinfo.c. Licensing is inspired from libaom (boilerplates, LICENSE and PATENTS). Add CMakeLists.txt as the build system configuration file. Add tests/avifinfo_test.cc and a 1x1 white pixel AVIF image compressed with libavif for testing purposes. Add README.md. Change-Id: I26244b666854523fce3e001d2be9f19574a4715f
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.