commit | 5c0741840957eaa080a52910b1f4950b400c3c6f | [log] [tgz] |
---|---|---|
author | Maryla <maryla@google.com> | Thu May 11 14:46:37 2023 +0200 |
committer | Maryla <maryla@google.com> | Fri Jun 02 13:29:57 2023 +0200 |
tree | 71e907d9e3548bcd8b970cf98a45e9d97f5a6a3e | |
parent | 8ed46385f4b6fb0b4680d791002cbd674b2b9cb6 [diff] |
Extract info related to gain maps and the primary item id. Change-Id: I53ca31a136e4ed1f78f2b70de56ca5117d3df3cb
libavifinfo is a standalone library that can be used to extract the width, height, bit depth, number of channels and other metadata 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.
The PHP implementation of libavifinfo is a subset of the C API.
libavifinfo
was implemented into php-src natively and is available through getimagesize()
at head. If it is not available in the PHP release version you use, you can fallback to avifinfo.php
instead.
See avifinfo_test.php
for a usage example.
Bug reports can be filed in the Alliance for Open Media issue tracker.