[wp-trac] [WordPress Trac] #60628: Issues with avif image imagecreatefromavif not working. Resizing not possible.

WordPress Trac noreply at wordpress.org
Fri May 24 19:28:18 UTC 2024


#60628: Issues with avif image  imagecreatefromavif not working. Resizing not
possible.
--------------------------+------------------------------
 Reporter:  neo2k23       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  6.5
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by skithund):

 Replying to [comment:5 adamsilverstein]:
 > It would be great if you can test this patch in your environment and
 tell me if it fixes the false positive you see?

 `imageavif` function exists, even though actual support for AVIF isn't
 there 🫠

 Not sure what would be the correct way to actually detect AVIF support.
 `imagecreatefromavif` gives `AVIF image support has been disabled` warning
 for any dir/file you feed to it, but it has to be valid/existing dir/file.

 Reproduction steps:

 Start a Docker shell in Ubuntu 23.04, which has PHP 8.1 and system GD
 without actual AVIF support
 {{{
 docker run -it ubuntu:23.04 /bin/bash
 }}}

 Install curl and PHP (in that docker shell) and fetch `kimono.avif` from
 this ticket
 {{{
 apt install -y curl php8.1-cli php8.1-gd
 curl -O
 https://core.trac.wordpress.org/attachment/ticket/60628/kimono.avif
 }}}

 Test commands
 {{{
 root at 047417a26e6d:/# php -r "var_dump(IMG_AVIF);"
 int(256)
 root at 047417a26e6d:/# php -r "var_dump(function_exists('imageavif'));"
 bool(true)
 root at 047417a26e6d:/# php -r
 "var_dump(function_exists('imagecreatefromavif'));"
 bool(true)
 root at 047417a26e6d:/# php -r "imagecreatefromavif('/kimono.avif');"
 PHP Warning:  imagecreatefromavif(): AVIF image support has been disabled
 root at 047417a26e6d:/# php -r
 "var_dump(imagecreatefromavif('/usr/bin/curl'));"
 PHP Warning:  imagecreatefromavif(): AVIF image support has been disabled
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60628#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list