commit | f50948793d6ae181d82c1255a40fb1becce6ee57 | [log] [tgz] |
---|---|---|
author | Yannis Guyon <yguyon@google.com> | Mon Jan 22 16:41:41 2024 +0000 |
committer | Yannis Guyon <yguyon@google.com> | Mon Jan 22 16:41:41 2024 +0000 |
tree | b331d02099453d5e39e61c059b6d3509bfceb862 | |
parent | b496868f7c3fd17dfeeecc0364fe37e19edd548a [diff] |
Fix $kAlphaStr in PHP libavifinfo implementation PHP strings do not behave exactly like C string literals. Fix for https://github.com/WordPress/wordpress-develop/pull/4612 Add more test cases in avifinfo_test.php. Change-Id: I00194cb141a860ac5547cc2238907e591cc24156
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: AvifInfoGetFeatures()
is designed to return the same avifImage
field values as avifDecoderParse()
. 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.