oerdnj / deb.sury.org

Public bugreports for anything ppa:ondrej/*
819 stars 27 forks source link

PHP8.2 AVIF image support has been disabled despite it being enabled #2024

Open alexscott64 opened 1 year ago

alexscott64 commented 1 year ago

Frequently asked questions

Describe the bug PHP 8.2 on Ubuntu 22.04 claims to have AVIF support, but running the function: imagecreatefromavif() results in the error: imagecreatefromavif() AVIF image support has been disabled

To Reproduce Steps to reproduce the behavior:

  1. Install PHP 8.2 and the gd extension using sudo add-apt-repository ppa:ondrej/php
  2. Using apache2, create a file and run echo phpinfo(); to confirm that AVIF Support is set to enabled
  3. Run $gd_image = imagecreatefromavif($image_path);
  4. This should result in the following warning: Warning: imagecreatefromavif(): AVIF image support has been disabled

What steps did you take to resolve issue yourself before reporting it here I saw this issue with php8.1 and saw that php8.2 should have fixed it, so I upgraded to php 8.2 on Ubuntu 22.04 and made sure that everything was up to date. Similarly, I saw this issue with avif codecs on ubuntu and confirmed that I am on the correct version of libavif (0.9.2 had the bug):

=|/ Name              Version      Architecture Description
+++-=================-============-============-====================================================
ii  libavif-dev:amd64 0.9.3-3      amd64        Library for handling .avif files (development files)
ii  libavif13:amd64   0.9.3-3      amd64        Library for handling .avif files

Expected behavior imagecreatefromavif() should work when AVIF image support is enabled.

Distribution (please complete the following information):

Package(s) (please complete the following information):

500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main i386 Packages
     release v=22.04,o=LP-PPA-ondrej-php,a=jammy,n=jammy,l=***** The main PPA for supported PHP versions with many PECL extensions *****,c=main,b=i386
     origin ppa.launchpadcontent.net
 500 https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy/main amd64 Packages
     release v=22.04,o=LP-PPA-ondrej-php,a=jammy,n=jammy,l=***** The main PPA for supported PHP versions with many PECL extensions *****,c=main,b=amd64
     origin ppa.launchpadcontent.net

Additional context Additionally, here is the GD package information coming from phpinfo:

GD Support enabled
GD headers Version 2.3.3
GD library Version 2.3.3
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
PNG Support enabled
WBMP Support enabled
XPM Support enabled
XBM Support enabled
WebP Support enabled
BMP Support enabled
AVIF Support enabled
TGA Read Support enabled
rfay commented 1 year ago

I'm sure this is a duplicate of

alexscott64 commented 1 year ago

I'm sure this is a duplicate of

They are running php8.1 which apparently wasn't compiled with AVIF support originally. See their output:

[AVIF Support] =>

In my case, AVIF support is enabled in GD info, yet, the function output seems to suggest otherwise. I was also told to open a new issue in that other thread.

rfay commented 1 year ago

Will be glad to see it work. Haven't seen it work in any version yet, and was hoping it would work with Debian 12 Bookworm as well, don't think it's working there yet.