commit | 885bf32c0f1169e0d3799111b43d3b6a38f1ed33 | [log] [tgz] |
---|---|---|
author | Yannis Guyon <yguyon@google.com> | Wed Jun 05 09:12:02 2024 +0000 |
committer | Yannis Guyon <yguyon@google.com> | Wed Jun 05 09:12:02 2024 +0000 |
tree | 357d6d0ab3f8c2670a74dbc39f40d7dd1b36c691 | |
parent | 524cad472fd3afe5353959f7b0a7a05692c66450 [diff] |
Add Rust implementation Change-Id: I749b335ee4f123d3adb7d9d92d7c14eb9948d90c
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 tests/avifinfo_demo.cc
for API 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.
Note: The C implementation AvifInfoGetFeatures()
is designed to return the same avifImage
field values as avifDecoderParse()
. However libavifinfo is often more permissive and may return features of images considered invalid by libavif.
Google C/C++ Style Guide is used in this project.
avifinfo.c
is written in C. To build from this directory:
cmake -S . -B build && \ cmake --build build --config Release
GoogleTest is required for the C++ tests (e.g. sudo apt install libgtest-dev
).
cmake -S . -B build -DAVIFINFO_BUILD_TESTS=ON && \ cmake --build build --config Debug && \ ctest --test-dir build build
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 tests/avifinfo_test.php
for a usage example.
cd tests && \ php avifinfo_test.php
The Rust implementation of libavifinfo is similar to the C API.
cargo build
See tests/avifinfo_test.rs
for a usage example.
cargo test
If you would like to contribute to libavifinfo, please follow the steps for libaom at https://aomedia.googlesource.com/aom/#submitting-patches. Summary:
cd libavifinfo && curl -Lo .git/hooks/commit-msg https://chromium-review.googlesource.com/tools/hooks/commit-msg && chmod u+x .git/hooks/commit-msg
git push https://aomedia.googlesource.com/libavifinfo/ HEAD:refs/for/main
Bug reports can be filed in the Alliance for Open Media issue tracker.