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

WordPress Trac noreply at wordpress.org
Sat May 25 06:42:21 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):

 This is the only ''reliable'' way to fix this, that I can think of.

 {{{
 // Only PHP versions 8.2.17, 8.3.4 and later have reliable image format
 detection
 if ( version_compare( PHP_VERSION, '8.2.17', '>=' ) && ( version_compare(
 PHP_VERSION, '8.3.0', '<' ) || version_compare( PHP_VERSION, '8.3.4', '>='
 ) ) ) {
   return ( $image_types & IMG_AVIF ) !== 0;
 } else {
   return false;
 }
 }}}

 Calling the actual `imageavif()` function to test for AVIF support doesn't
 even return `false`. Returns `true` and "AVIF image support has been
 disabled" warning.

 From [https://www.php.net/manual/en/function.imageavif.php PHP doc]
 > Return Values
 > Returns true on success or false on failure.
 > __**Caution** However, if libgd fails to output the image, this function
 returns true.__

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


More information about the wp-trac mailing list