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

WordPress Trac noreply at wordpress.org
Sat Feb 24 12:46:17 UTC 2024


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

 I don't know if i am at the right place but i am testing the new avif
 image format on wp 6.5 beta  and i have issues with it. The function call
 imagecreatefromavif  does not return a image.  So from that moment on it
 is not possible to create a resized image.

 When i upload a avif image in the media library the thumbs are not
 created. The  function call imagecreatefromavif in the class-wp-image-
 editor-gd.php also does not return a image and does not create the resized
 thumbs.  It fails.

 Is this a php issue or a wordpress issue?

 Image 1 shows no thumbs are created by wordpress from uploaded avif image
 files

 https://share.zight.com/d5u2OZEA

 I tried it with this image  from github

 https://raw.githubusercontent.com/link-u/avif-sample-
 images/master/kimono.avif

 It simply does not create resized images.

 A simple test code with the hardcoded url to the image file returns false

 {{{#!php
 <?php
                 $file =  'var/docs/server.tst/public/wp-
 content/uploads/2024/02/kimono.avif';
                 if ( function_exists( 'imagecreatefromavif' ) && (
 'image/avif' === wp_get_image_mime( $file ) ) ) {
                         $image = @imagecreatefromavif( $file );
                         $valid = ( $image != FALSE );
                         if ( !$valid )  echo 'avif imaged failed to create
 !';
                 }
 }}}

 To test this  uplaod the image and adjust the hardcoded url to point to
 the correct image.

 Please advice about what  is going on.

 Thank you for your time.

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


More information about the wp-trac mailing list