commit | c7dc947ec9c993e9c559b2153050ebe301ff4fcc | [log] [tgz] |
---|---|---|
author | Yannis Guyon <yguyon@google.com> | Mon Feb 14 14:58:03 2022 +0100 |
committer | Yannis Guyon <yguyon@google.com> | Mon Feb 14 14:58:03 2022 +0100 |
tree | 5588ab5000b4b80f2be3251c8ab5b1f7b8f67035 | |
parent | 303328511ac1bd8d76b6d6a680646f57650b786c [diff] |
Fix fuzz timeout A 1MB video was decoded once for each byte. Reducing the amount of parsings fixes the timeout. Also C++ify avifinfo_fuzz.cc which was partly C. Change-Id: Ia967a61bf1369e2a21f0f1326579de29deb7faa9
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.
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.