Learn about Centmin Mod LEMP Stack today
Become a Member

Upgrade PHP-FPM Upgrading from PHP 8.1 to PHP 8.2 removes AVIF support

Discussion in 'Install & Upgrades or Pre-Install Questions' started by iaTa, Feb 9, 2025.

  1. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    • CentOS Version: AlmaLinux 9.5
    • Centmin Mod Version Installed: 140.00beta01.b199
    • Nginx Version Installed: 1.27.4
    • PHP Version Installed: 8.1.31 / 8.2.27
    • MariaDB MySQL Version Installed: 10.6.21
    • When was last time updated Centmin Mod code base: Today
    • Persistent Config:
      Code (Text):
      MARIADB_INSTALLTENTWO='n'
      MARIADB_INSTALLTENTHREE='n'
      MARIADB_INSTALLTENFOUR='n'
      MARIADB_INSTALLTENFIVE='n'
      MARIADB_INSTALLTENSIX='y'
      OPENSSL_SYSTEM_USE='n'
      AWS_LC_SWITCH='y'
      NEEDRESTART_CHECK='y'
      VHOSTCTRL_CLOUDFLAREINC='y'
      LETSENCRYPT_DETECT='y'
      DUALCERTS='y'
      NGINX_SSLCACHE_ALLOWOVERRIDE='y'
      NGINX_STAPLE_CACHE_OVERRIDE='y'
      NGINX_STAPLE_CACHE_TTL='86400'
      ZSTD_LOGROTATE_NGINX='y'
      ZSTD_LOGROTATE_PHPFPM='y'
      SELFSIGNEDSSL_ECDSA='y'
      NGINX_LIBBROTLI='y'
      NGXDYNAMIC_BROTLI='y'
      PHP_BROTLI='y'
      PHP_LZFOUR='y'
      PHP_LZF='y'
      PHP_ZSTD='y'
      DMOTD_PHPCHECK='y'
      PHPFINFO='y'
      WPCLI_CE_QUERYSTRING_INCLUDED='y'
      MARCH_TARGETNATIVE='y'
      MARCH_TARGETNATIVE_ALWAYS='y'
      PHP_LIBGD_EXTERNAL='y'
      PHP_GD_AVIF='y'
      
    PHP 8.2 Upgrade Log

    removed

    PHP 8.1.31
    Code (Text):
    php --ri gd
    
    gd
    
    GD Support => enabled
    GD headers Version => 2.3.2
    GD library Version => 2.3.2
    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
    
    Directive => Local Value => Master Value
    gd.jpeg_ignore_warning => 1 => 1
    

    PHP 8.2.27
    Code (Text):
    php --ri gd
    
    gd
    
    GD Support => enabled
    GD headers Version => 2.3.2
    GD library Version => 2.3.2
    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
    TGA Read Support => enabled
    
    Directive => Local Value => Master Value
    gd.jpeg_ignore_warning => On => On
    


     
    Last edited: Feb 11, 2025
  2. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Yeah it's a bug somewhere that I haven't found the cause of yet. For now use Imagick instead of GD php extension for AVIF. Imagick should work
    Code (Text):
    php --ri imagick
     
  3. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    The Modern Image Formats plugin from the WordPress Performance Team still shows 'AVIF support is not available' after running that command and restarting when using PHP 8.2 - AVIF worked fine on PHP 8.1 via GD.
    Code (Text):
    php --ri imagick
    
    imagick
    
    imagick module => enabled
    imagick module version => @PACKAGE_VERSION@
    imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
    Imagick compiled with ImageMagick version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    Imagick using ImageMagick library version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
    ImageMagick release date => 2024-12-22
    ImageMagick number of supported formats:  => 250
    ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
    
    Directive => Local Value => Master Value
    imagick.locale_fix => 0 => 0
    imagick.skip_version_check => 0 => 0
    imagick.progress_monitor => 0 => 0
    imagick.set_single_thread => 1 => 1
    imagick.shutdown_sleep_count => 10 => 10
    imagick.allow_zero_dimension_images => 0 => 0
    

    Under site health it still shows the active image editor as GD:
    Code (Text):
    Active editor    WP_Image_Editor_GD
    ImageMagick version number    1693
    ImageMagick version string    ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    Imagick version    @PACKAGE_VERSION@
    File uploads    Enabled
    Max size of post data allowed    640M
    Max size of an uploaded file    640M
    Max effective file size    640 MB
    Max simultaneous file uploads    20
    GD version    2.3.2
    GD supported file formats    GIF, JPEG, PNG, WebP, BMP, XPM
    Ghostscript version    Not available
    

    I've tried using a couple of plugins (ImageMagick Engine being one) to force the active editor to Imagick but no luck. It's odd as I thought WordPress defaulted to Imagick over GD.

    I've also tried a custom php snippet using image editor filters to force Imagick, and when I do that the active editor is blank, so it looks like WordPress just isn't able to use Imagick.

    Any ideas?
     
    Last edited: Feb 10, 2025
  4. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    it's a weird bug as I can't reproduce it all the time, for instance on AlmaLinux 8.10 with PHP 8.2.17
    Code (Text):
    PHP_LIBGD_EXTERNAL='y'
    PHP_GD_AVIF='y'
    

    Code (Text):
    php -v
    PHP 8.2.17 (cli) (built: Feb  9 2025 13:43:39) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.2.17, Copyright (c) Zend Technologies
        with Zend OPcache v8.2.17, Copyright (c), by Zend Technologies
    

    Code (Text):
    php --ri gd
    
    gd
    
    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
    
    Directive => Local Value => Master Value
    gd.jpeg_ignore_warning => On => On
    

    can you show the output for this command wrapped in CODE/CODEB bbcode tags
    Code (Text):
    ldd $(which php-fpm) | grep avif

    Code (Text):
    ldd $(which php-fpm) | grep avif
            libavif.so.14 => /lib64/libavif.so.14 (0x00007fef36f44000)
    

    It's one of the bugs I haven't been able to fix as yet. Still working on it. Could also be specific to EL9 OS and not EL8 OSes

    standalone PHP AVIF script checker
    PHP:
    <?php
    /**
     * Standalone AVIF support checker.
     *
     * This script checks if the current PHP installation supports the AVIF image format
     * using either the Imagick extension or the GD extension. It then outputs a JSON
     * result that summarizes the check.
     *
     * To use, simply run this script via your web server or from the command line:
     *     php avif-checker.php
     */

    /**
     * Checks if AVIF is supported.
     *
     * @return bool True if AVIF is supported; otherwise, false.
     */
    function is_avif_supported(): bool {
        
    // Check using the Imagick extension.
        
    if (extension_loaded('imagick')) {
            try {
                
    $imagick = new Imagick();
                
    // Retrieve supported formats and convert them to uppercase.
                
    $formats array_map('strtoupper'$imagick->queryFormats());
                if (
    in_array('AVIF'$formatstrue)) {
                    return 
    true;
                }
            } catch (
    Exception $e) {
                
    // If an exception occurs, we simply ignore Imagick in this check.
            
    }
        }

        
    // Check using the GD extension.
        
    if (extension_loaded('gd')) {
            
    $gdInfo gd_info();
            
    // As of PHP 8.1, GD might report AVIF support with a key like 'AVIF Support'.
            
    if (isset($gdInfo['AVIF Support']) && $gdInfo['AVIF Support'] === true) {
                return 
    true;
            }
        }

        return 
    false;
    }

    /**
     * Returns an array of details about AVIF support.
     *
     * The structure of the returned array mirrors that used in the original plugin code.
     *
     * @return array{
     *     label: string,
     *     status: string,
     *     badge: array{label: string, color: string},
     *     description: string,
     *     actions: string,
     *     test: string
     * }
     */
    function get_avif_support_status(): array {
        
    $avifSupported is_avif_supported();

        if (
    $avifSupported) {
            return [
                
    'label'       => 'Your site supports AVIF',
                
    'status'      => 'good',
                
    'badge'       => [
                    
    'label' => 'Performance',
                    
    'color' => 'blue',
                ],
                
    'description' => '<p>The AVIF image format generally has better compression than WebP, JPEG, PNG, and GIF and is designed to supersede them, which can reduce page load time and consume less bandwidth.</p>',
                
    'actions'     => '',
                
    'test'        => 'is_avif_uploads_enabled',
            ];
        } else {
            return [
                
    'label'       => 'Your site does not support AVIF',
                
    'status'      => 'recommended',
                
    'badge'       => [
                    
    'label' => 'Performance',
                    
    'color' => 'blue',
                ],
                
    'description' => '<p>The AVIF image format generally has better compression than WebP, JPEG, PNG, and GIF and is designed to supersede them, which can reduce page load time and consume less bandwidth.</p>',
                
    'actions'     => '<p>AVIF support can only be enabled by your hosting provider, so contact them for more information.</p>',
                
    'test'        => 'is_avif_uploads_enabled',
            ];
        }
    }

    // Get the AVIF support status.
    $status get_avif_support_status();

    // Output the result as JSON.
    header('Content-Type: application/json');
    echo 
    json_encode($statusJSON_PRETTY_PRINT);
    Code (Text):
    php cavif.php
    {
        "label": "Your site supports AVIF",
        "status": "good",
        "badge": {
            "label": "Performance",
            "color": "blue"
        },
        "description": "<p>The AVIF image format generally has better compression than WebP, JPEG, PNG, and GIF and is designed to supersede them, which can reduce page load time and consume less bandwidth.<\/p>",
        "actions": "",
        "test": "is_avif_uploads_enabled"
    }
    
     
  5. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    That command gives no output.

    I also updated my previous post with some info on Imagick - I can't even force WordPress to use it.
     
  6. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Actually see in your PHP 8.2 upgrade log failed libgd 2.3.3 download
    Code (Text):
    Internal libgd 2.3.3 external PHP version
    
    /svr-setup /svr-setup/php-8.2.27/fpm-build /usr/local/src/centminmod
    /usr/local/src/centminmod/inc/php_configure.inc: line 406: cd: libgd-2.3.3: No such file or directory
    Downloading and applying libgd patch for version 2.3.3...
    

    try deleting broken downloads, and re-run centmin.sh menu option 5 so it redownloads libgd 2.3.3 again
    Code (Text):
    cd /svr-setup/libgd-2.3.3
    rm -rf /svr-setup/libgd-2.3.3*
    
     
  7. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    /svr-setup/libgd-2.3.3 directory doesn't exist and I've tried switching between 8.1 and 8.2 a few times now.

    The tarball is present in /svr-setup though: 3593182 Dec 7 2021 libgd-2.3.3.tar.gz

    It seems fine too, just not extracted.

    Should I manually extract and try option 5 again?

    Output from the checker script:
    Code (Text):
    {
       "label": "Your site supports AVIF",
       "status": "good",
       "badge": {
           "label": "Performance",
           "color": "blue"
       },
       "description": "<p>The AVIF image format generally has better compression than WebP, JPEG, PNG, and GIF and is designed to supersede them, which can reduce page load time and consume less bandwidth.<\/p>",
       "actions": "",
       "test": "is_avif_uploads_enabled"
    }
    
     
    Last edited: Feb 10, 2025
  8. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    delete existing ones and let centmin.sh menu option 5 handle it again
    Code (Text):
    cd /svr-setup/libgd-2.3.3
    rm -rf /svr-setup/libgd-2.3.3*
    
     
  9. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    So libgd-2.3.3 installed this time but no AVIF available and WordPress is still using GD over Imagick.
    Code (Text):
    php --ri gd
    
    gd
    
    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
    TGA Read Support => enabled
    
    Directive => Local Value => Master Value
    gd.jpeg_ignore_warning => On => On
    

    Code (Text):
    ldd $(which php-fpm) | grep avif
        libavif.so.15 => /lib64/libavif.so.15 (0x00007fc1068a7000)
    
     
    Last edited: Feb 11, 2025
  10. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Maybe How to Enable Imagick on Your WordPress Site (Easy Way)

    Yeah that's the random bug I experience, sometimes it shows AVIF, sometimes not. Haven't been able to figure it out yet. I don't use your plugin, but look at using PHP AVIF via Imagick instead of GD

    Under ImageMagick supported formats list look for AVIF
    Code (Text):
    php --ri imagick
    
    imagick
    
    imagick module => enabled
    imagick module version => @PACKAGE_VERSION@
    imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
    Imagick compiled with ImageMagick version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    Imagick using ImageMagick library version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
    ImageMagick release date => 2024-12-22
    ImageMagick number of supported formats:  => 250
    ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
    
    Directive => Local Value => Master Value
    imagick.locale_fix => 0 => 0
    imagick.skip_version_check => 0 => 0
    imagick.progress_monitor => 0 => 0
    imagick.set_single_thread => 1 => 1
    imagick.shutdown_sleep_count => 10 => 10
    imagick.allow_zero_dimension_images => 0 => 0
    
     
  11. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
  12. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    The other thing to try is updating to PHP 8.3.16 which may show libgd with AVIF support (yeah it's random).
     
  13. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    Yeah PHP Imagick shows support for AVIF.
    Code (Text):
    php --ri imagick
    
    imagick
    
    imagick module => enabled
    imagick module version => @PACKAGE_VERSION@
    imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
    Imagick compiled with ImageMagick version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    Imagick using ImageMagick library version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
    ImageMagick release date => 2024-12-22
    ImageMagick number of supported formats:  => 250
    ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
    
    Directive => Local Value => Master Value
    imagick.locale_fix => 0 => 0
    imagick.skip_version_check => 0 => 0
    imagick.progress_monitor => 0 => 0
    imagick.set_single_thread => 1 => 1
    imagick.shutdown_sleep_count => 10 => 10
    imagick.allow_zero_dimension_images => 0 => 0
    

    If you check my posts from earlier, I've tried that plugin (which shows Imagick PHP module found) and separately tried a php code snippet using filters to force WordPress to use Imagick.

    Neither work. In fact when I force Imagick, site health shows nothing for active editor and even webp conversions stop working.

    WordPress should use Imagick over GD by default anyway.
     
  14. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    Upgraded to PHP 8.3.16 and no AVIF support in GD.
     
  15. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Yeah as I said random issue works on some but not others. I did find that on no working ones like EL9 OSes, php-fpm compile/upgrade logs show

    Code (Text):
    checking for working gdImageCreateFromAvif in libgd... no

    and PHP config.log log shows more detail for result = no
    Code (Text):
    zcat /root/centminlogs/php-compile-config-100225-013431.log.gz | grep Avif -C3
    configure:37584: ./conftest
    configure:37584: $? = 0
    configure:37586: result: yes
    configure:37616: checking for working gdImageCreateFromAvif in libgd
    configure:37651: ccache /opt/rh/gcc-toolset-13/root/usr/bin/gcc -o conftest -O3 -m64 -march=native -pipe -gsplit-dwarf -Wno-deprecated-declarations -Wimplicit-fallthrough=0 -Wno-implicit-function-declaration -Wno-int-conversion -Wno-error=unused-result -Wno-unused-result -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -Wno-missing-profile -Wno-pointer-to-int-cast -Wno-error=strict-prototypes -Wno-attribute-warning -Wno-enum-int-mismatch -Wno-stringop-overflow -fcode-hoisting -Wno-cast-function-type -Wno-error=cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -fstack-protector-strong -fPIC -ffp-contract=off -fvisibility=hidden -I/usr/local/libgd/2.3.3/include  -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -Wl,-rpath,/usr/lib64/../lib64 -L/usr/lib64/../lib64 -Wl,-rpath,/usr/local/libgd/2.3.3/lib -L/usr/local/libgd/2.3.3/lib conftest.c -lbz2 -lrt -lm  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lssl -lcrypto -lxml2 -lenchant -lgmodule-2.0 -lglib-2.0 -lffi -lssl -lcrypto -lgd  >&5
    configure:37651: $? = 0
    configure:37651: ./conftest
    --
    | int main(int argc, char** argv) {
    |   FILE* f = NULL;
    |   gdSetErrorMethod(exit1);
    |   gdImagePtr p = gdImageCreateFromAvif(f);
    |   return 0;
    | }
    configure:37661: result: no
    

    so failed test for gdImageCreateFromAvif in libgd is when libgd 2.3.3 does not report AVIF enabled.

    while on working libgd reported AVIF support enabled it's
    Code (Text):
    checking for working gdImageCreateFromAvif in libgd... yes


    and more detailed PHP config log where result = yes
    Code (Text):
    zcat /root/centminlogs/php-compile-config-090225-193624.log.gz | grep Avif -C5
    configure:37572: ccache /opt/rh/gcc-toolset-13/root/usr/bin/gcc -o conftest -O3 -m64 -march=skylake -pipe -gsplit-dwarf -Wno-deprecated-declarations -Wimplicit-fallthrough=0 -Wno-implicit-function-declaration -Wno-int-conversion -Wno-error=unused-result -Wno-unused-result -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -Wno-missing-profile -Wno-pointer-to-int-cast -Wno-error=strict-prototypes -Wno-attribute-warning -Wno-enum-int-mismatch -Wno-stringop-overflow -fcode-hoisting -Wno-cast-function-type -Wno-error=cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -fstack-protector-strong -fPIC -ffp-contract=off -fvisibility=hidden -I/usr/local/libgd/2.3.3/include  -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -Wl,-rpath,/usr/local/libgd/2.3.3/lib -L/usr/local/libgd/2.3.3/lib conftest.c -lbz2 -lutil -lrt -lm -ldl  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lenchant -lgmodule-2.0 -lglib-2.0 -lffi -lssl -lcrypto -lgd  >&5
    configure:37572: $? = 0
    configure:37572: ./conftest
    configure:37572: $? = 0
    configure:37574: result: yes
    configure:37604: checking for working gdImageCreateFromAvif in libgd
    configure:37639: ccache /opt/rh/gcc-toolset-13/root/usr/bin/gcc -o conftest -O3 -m64 -march=skylake -pipe -gsplit-dwarf -Wno-deprecated-declarations -Wimplicit-fallthrough=0 -Wno-implicit-function-declaration -Wno-int-conversion -Wno-error=unused-result -Wno-unused-result -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -Wno-missing-profile -Wno-pointer-to-int-cast -Wno-error=strict-prototypes -Wno-attribute-warning -Wno-enum-int-mismatch -Wno-stringop-overflow -fcode-hoisting -Wno-cast-function-type -Wno-error=cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -fstack-protector-strong -fPIC -ffp-contract=off -fvisibility=hidden -I/usr/local/libgd/2.3.3/include  -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -Wl,-rpath,/usr/local/libgd/2.3.3/lib -L/usr/local/libgd/2.3.3/lib conftest.c -lbz2 -lutil -lrt -lm -ldl  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lenchant -lgmodule-2.0 -lglib-2.0 -lffi -lssl -lcrypto -lgd  >&5
    configure:37639: $? = 0
    configure:37639: ./conftest
    configure:37639: $? = 0
    configure:37641: result: yes
    

    • EPEL EL8 provides libavif-devel 0.10.1
    • EPEL EL9 provides libavif-devel 0.11.5 so might be an issue in this version?
    That's as far as I have gotten in troubleshooting/time for right now
     
  16. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    Ok, I'll switch back to PHP 8.1 for now. Thank you for your help trying to figure it out.

    Still confused why WordPress isn't using Imagick by default, and even when forced.

    Attaching php-compile-config-log greps in case they're helpful:

    PHP 8.1.31 result = yes
    Code (Text):
    configure:37210: checking for gdImageCreateFromAvif in -lgd
    configure:37235: ccache /opt/rh/gcc-toolset-12/root/usr/bin/gcc -o conftest -O3 -m64 -march=skylake-avx512 -pipe -gsplit-dwarf -Wno-deprecated-declarations -Wimplicit-fallthrough=0 -Wno-implicit-function-declaration -Wno-int-conversion -Wno-error=unused-result -Wno-unused-result -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -Wno-missing-profile -Wno-pointer-to-int-cast -Wno-error=strict-prototypes -Wno-attribute-warning -Wno-enum-int-mismatch -Wno-stringop-overflow -fcode-hoisting -Wno-cast-function-type -Wno-error=cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -fstack-protector-strong -fPIC -fvisibility=hidden  -D_FORTIFY_SOURCE=2  -Wl,-rpath,/usr/lib64/../lib64 -L/usr/lib64/../lib64 -Wl,-rpath,/usr/local/libgd/2.3.3/lib -L/usr/local/libgd/2.3.3/lib conftest.c -lgd  -lbz2 -lrt -lm  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lssl -lcrypto -lxml2 -lenchant -lgmodule-2.0 -lglib-2.0 -lffi -lssl -lcrypto -lgd >&5
    configure:37235: $? = 0
    configure:37244: result: yes
    

    PHP 8.3.16 result = no (same output for PHP 8.2.27, excluding package version)
    Code (Text):
    configure:37616: checking for working gdImageCreateFromAvif in libgd
    configure:37651: ccache /opt/rh/gcc-toolset-12/root/usr/bin/gcc -o conftest -O3 -m64 -march=skylake-avx512 -pipe -gsplit-dwarf -Wno-deprecated-declarations -Wimplicit-fallthrough=0 -Wno-implicit-function-declaration -Wno-int-conversion -Wno-error=unused-result -Wno-unused-result -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -Wno-missing-profile -Wno-pointer-to-int-cast -Wno-error=strict-prototypes -Wno-attribute-warning -Wno-enum-int-mismatch -Wno-stringop-overflow -fcode-hoisting -Wno-cast-function-type -Wno-error=cast-align -Wno-implicit-function-declaration -Wno-builtin-declaration-mismatch -Wno-return-local-addr -Wno-maybe-uninitialized -Wno-array-parameter -Wno-alloc-size-larger-than -Wno-address -Wno-array-bounds -Wno-deprecated-declarations -Wno-discarded-qualifiers -Wno-stringop-overread -Wno-stringop-truncation -fstack-protector-strong -fPIC -ffp-contract=off -fvisibility=hidden -I/usr/local/libgd/2.3.3/include  -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE  -Wl,-rpath,/usr/lib64/../lib64 -L/usr/lib64/../lib64 -Wl,-rpath,/usr/local/libgd/2.3.3/lib -L/usr/local/libgd/2.3.3/lib conftest.c -lbz2 -lrt -lm  -lsystemd -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lsqlite3 -lz -lcurl -lssl -lcrypto -lxml2 -lenchant -lgmodule-2.0 -lglib-2.0 -lffi -lssl -lcrypto -lgd  >&5
    configure:37651: $? = 0
    configure:37651: ./conftest
    configure:37651: $? = 1
    configure: program exited with status 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "PHP"
    | #define PACKAGE_TARNAME "php"
    | #define PACKAGE_VERSION "8.3.16"
    --
    | /* A custom gdErrorMethod */
    | void exit1(int priority, const char *format, va_list args) {
    |   _exit(1);
    | }
    |
    | /* Override the default gd_error_method with one that
    |    actually causes the program to return an error. */
    | int main(int argc, char** argv) {
    |   FILE* f = NULL;
    |   gdSetErrorMethod(exit1);
    |   gdImagePtr p = gdImageCreateFromAvif(f);
    |   return 0;
    | }
    configure:37661: result: no
    
     
    Last edited: Feb 10, 2025
  17. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    Unsure if relevant but noticed that the PHP 8.3.16 'result = no' conftest has some additional switches which the PHP 8.1.31 'result = yes' conftest doesn't have:
    Code (Text):
    -ffp-contract=off
    -I/usr/local/libgd/2.3.3/include
    -D_GNU_SOURCE
    
     
    Last edited: Feb 10, 2025
  18. iaTa

    iaTa Member

    89
    16
    8
    Mar 26, 2018
    Ratings:
    +32
    Local Time:
    10:58 PM
    Nginx 1.31.x
    MariaDB 10.11.x
    It seems WordPress isn't using Imagick due to "Imagick version" being returned as "@PACKAGE_VERSION@" as shown under Site Health -> Media Handling, which does not pass the version_compare() check in WP_Image_Editor_Imagick::test(), and so WordPress falls back to GD every time.

    /svr-setup/imagick-php8/php_imagick.h shows the version as "@PACKAGE_VERSION@":
    Code (Text):
    /* Define Extension Properties */
    #define PHP_IMAGICK_EXTNAME    "imagick"
    // The version is deliberately left as 'PACKAGE_VERSION' in source code.
    // It is only replaced with the actual version number that packaged through pecl.php.net
    #define PHP_IMAGICK_VERSION    "@PACKAGE_VERSION@"
    #define PHP_IMAGICK_EXTNUM     30700
    

    /svr-setup/imagick-3.7.0/php_imagick.h shows the version as "3.7.0":
    Code (Text):
    /* Define Extension Properties */
    #define PHP_IMAGICK_EXTNAME    "imagick"
    // The version is deliberately left as 'PACKAGE_VERSION' in source code.
    // It is only replaced with the actual version number that packaged through pecl.php.net
    #define PHP_IMAGICK_VERSION    "3.7.0"
    #define PHP_IMAGICK_EXTNUM     30700
    

    Only the releases from PECL :: Package :: imagick contain the correct version string, the official imagick github doesn't https://github.com/Imagick/imagick.
    Code (Text):
    php --ri imagick
    
    imagick
    
    imagick module => enabled
    imagick module version => @PACKAGE_VERSION@
    imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
    Imagick compiled with ImageMagick version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    Imagick using ImageMagick library version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
    ImageMagick release date => 2024-12-22
    ImageMagick number of supported formats:  => 250
    ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
    
    Directive => Local Value => Master Value
    imagick.locale_fix => 0 => 0
    imagick.skip_version_check => 0 => 0
    imagick.progress_monitor => 0 => 0
    imagick.set_single_thread => 1 => 1
    imagick.shutdown_sleep_count => 10 => 10
    imagick.allow_zero_dimension_images => 0 => 0
    
     
    Last edited: Feb 11, 2025
  19. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    Cheers, your PHP 8.3.16 seems different to my 8.3.16 run though both still result in libgd still not reporting AVIF enabled support.
    Ah yes, will need to fix the package version since Github version is being used for PHP 8 support
     
  20. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    7:58 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    fixed in latest 131.00stable and 140.00beta01 now, so run cmupdate first
    Code (Text):
    php --ri imagick
    
    imagick
    
    imagick module => enabled
    imagick module version => 3.7.0
    imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
    Imagick compiled with ImageMagick version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    Imagick using ImageMagick library version => ImageMagick 6.9.13-21 Q16 x86_64 18557 https://legacy.imagemagick.org
    ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
    ImageMagick release date => 2024-12-22
    ImageMagick number of supported formats:  => 250
    ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FLV, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HEIF, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
    
    Directive => Local Value => Master Value
    imagick.locale_fix => 0 => 0
    imagick.skip_version_check => 0 => 0
    imagick.progress_monitor => 0 => 0
    imagick.set_single_thread => 1 => 1
    imagick.shutdown_sleep_count => 10 => 10
    imagick.allow_zero_dimension_images => 0 => 0
    

    test script called avif_test.php
    PHP:
    <?php
    // (1) Check if AVIF is supported
    $formats Imagick::queryFormats('AVIF');
    if (
    in_array('AVIF'$formats)) {
        echo 
    "AVIF support detected in Imagick.\n";
    } else {
        echo 
    "AVIF support NOT detected in Imagick.\n";
        exit(
    1);
    }

    // (2) Test creating an AVIF image
    try {
        
    // Create a blank 200x200 white image
        
    $image = new Imagick();
        
    $image->newImage(200200, new ImagickPixel('white'));
        
    $image->setImageFormat('avif');

        
    // Define a temporary file path for the output image
        
    $tempFile sys_get_temp_dir() . DIRECTORY_SEPARATOR 'test.avif';
        
        if (
    $image->writeImage($tempFile)) {
            echo 
    "AVIF image successfully created at: $tempFile\n";
            echo 
    "File size: " filesize($tempFile) . " bytes\n";
            
    // Optionally, read the image back to confirm the format:
            
    $check = new Imagick($tempFile);
            echo 
    "Image format is: " $check->getImageFormat() . "\n";
        } else {
            echo 
    "Failed to create AVIF image.\n";
        }
    } catch (
    Exception $e) {
        echo 
    "Error: " $e->getMessage() . "\n";
    }
    ?>
    Code (Text):
    php avif_test.php
    
    AVIF support detected in Imagick.
    AVIF image successfully created at: /tmp/test.avif
    File size: 316 bytes
    Image format is: AVIF