mirror of
https://github.com/php/php-src.git
synced 2026-03-28 10:12:18 +01:00
See #80828 and the internals@ mailing list discussion at https://externals.io/message/116543 Use libavifinfo's AvifInfoGetFeaturesStream() in php_handle_avif() to get the width, height, bit depth and channel count from an AVIF payload. Implement stream reading/skipping functions and data struct. Use libavifinfo's AvifInfoIdentifyStream() in php_is_image_avif(). Update the expected features read from "test1pix.avif" in getimagesize.phpt. Closes GH-7711.
AVIF-info
There is no compact, reliable way to determine the size of an AVIF image. A standalone C snippet called libavifinfo was created to partially parse an AVIF payload and to extract the width, height, bit depth and channel count without depending on the full libavif library.
avifinfo.h, avifinfo.c, LICENSE and PATENTS were copied verbatim from:
https://aomedia.googlesource.com/libavifinfo/+/96f34d945ac7dac229feddfa94dbae66e202b838
They can easily be kept up-to-date the same way.