Topic: PHP 8.1 and imageavif

Hey Remy!
I came across your answer about the imageavif function in PHP 8.1: https://stackoverflow.com/questions/717 … n-disabled
I have the following config:
PHP 8.1.6 (cli) (built: May 11 2022 01:14:18) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.6, Copyright (c), by Zend Technologies
and
CentOS Linux release 7.7.1908 (Core)
I tried to install php81-php-pecl-vips, vips-heif and libheif from the rpmfusion repository - installed without errors:

=============================================================================================================================================================================================================================================
 Package                                                     Arch                                           Version                                                     Repository                                                      Size
=============================================================================================================================================================================================================================================
Installing:
 libheif                                                     x86_64                                         1.4.0-1.el7.remi                                            remi-safe                                                      205 k
 php81-php-pecl-vips                                         x86_64                                         1.0.13-1.el7.remi                                           remi-safe                                                       29 k
 vips-heif                                                   x86_64                                         8.12.2-2.el7.remi                                           remi-safe                                                       34 k
Installing for dependencies:
 OpenEXR-libs                                                x86_64                                         1.7.1-8.el7                                                 base                                                           217 k
 cfitsio                                                     x86_64                                         3.370-10.el7                                                epel                                                           528 k
 fftw-libs-double                                            x86_64                                         3.3.3-8.el7                                                 base                                                           759 k
 hdf5                                                        x86_64                                         1.8.12-13.el7                                               epel                                                           1.6 M
 ilmbase                                                     x86_64                                         1.0.3-7.el7                                                 base                                                           100 k
 libaec                                                      x86_64                                         1.0.4-1.el7                                                 epel                                                            34 k
 libde265                                                    x86_64                                         1.0.2-6.el7                                                 rpmfusion-free-updates                                         280 k
 libexif                                                     x86_64                                         0.6.22-2.el7_9                                              updates                                                        423 k
 libgsf                                                      x86_64                                         1.14.26-7.el7                                               base                                                           166 k
 librsvg2                                                    x86_64                                         2.40.20-1.el7                                               base                                                           132 k
 matio                                                       x86_64                                         1.5.17-3.el7                                                epel                                                           118 k
 openslide                                                   x86_64                                         3.4.1-1.el7                                                 epel                                                           104 k
 orc                                                         x86_64                                         0.4.26-1.el7                                                base                                                           166 k
 poppler                                                     x86_64                                         0.26.5-43.el7.1                                             updates                                                        787 k
 poppler-data                                                noarch                                         0.4.6-3.el7                                                 base                                                           2.2 M
 poppler-glib                                                x86_64                                         0.26.5-43.el7.1                                             updates                                                        142 k
 vips                                                        x86_64                                         8.12.2-2.el7.remi                                           remi-safe                                                      1.4 M
 vips-openslide                                              x86_64                                         8.12.2-2.el7.remi                                           remi-safe                                                       30 k
 vips-poppler                                                x86_64                                         8.12.2-2.el7.remi                                           remi-safe                                                       30 k
 x265-libs                                                   x86_64                                         2.9-3.el7                                                   rpmfusion-free-updates                                         1.8 M

Transaction Summary
=============================================================================================================================================================================================================================================

But the function imageavif() that didn't work:

# php -i | grep AVIF
AVIF Support => enabled
# php -r 'var_dump(gd_info());'
array(15) {
  ["GD Version"]=>
  string(5) "2.3.3"
...
  ["AVIF Support"]=>
  bool(true)

# php -r 'var_dump(imageavif(imagecreatetruecolor(8, 8), "/tmp/test"));'
PHP Warning: imageavif(): AVIF image support has been disabled
 in Command line code on line 1
bool(true)

Can you tell me what else can be done? Or do I still need to somehow install libavif and libavif-devel?

Re: PHP 8.1 and imageavif

vips and imagick are different extensions, so with different API

See:
- vips => https://github.com/libvips/php-vips-ext
- imagick => https://www.php.net/imagick


Notice: if you want modern feature, on modern PHP (8.1), I recommend you use a modern distro (EL-8 of even EL-9), not using a 8 years old EL-7 which is close to its EOL (in 2 years)


P.S. libavif have too much missing dependencies to be added and maintained in my repository, so waiting for it in EPEL https://bugzilla.redhat.com/2071940

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: PHP 8.1 and imageavif

Side note:
EL-8 and EL-9 now have libavif (in EPEL)
and new gd build take benefit of it.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi