[wp-trac] [WordPress Trac] #64322: PHP 8.5: HEIF/HEIC support added to `getimagesize()`

WordPress Trac noreply at wordpress.org
Mon Dec 1 06:56:04 UTC 2025


#64322: PHP 8.5: HEIF/HEIC support added to `getimagesize()`
-------------------------------------------------+-------------------------
 Reporter:  desrosj                              |       Owner:  desrosj
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.9
Component:  Media                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php php85 has-patch dev-feedback     |     Focuses:  php-
  fixed-major                                    |  compatibility
-------------------------------------------------+-------------------------

Comment (by desrosj):

 Replying to [comment:9 ellatrix]:
 > How come this issue only popped up now?

 This failure was caused by the change to the PHP Docker containers (that
 the PHPUnit tests run inside of and we we maintain) on November 29, that
 [https://github.com/WordPress/wpdev-docker-images/pull/20 updated the 8.5
 image to use PHP 8.5.0 instead of PHP 8.5.0RC5, and the Imagick extension
 was added].

 This meant that any new PHPUnit Test workflow that ran from that point
 forward would run with the new containers. I am not sure why this surfaced
 in 8.5.0 GA and not in 8.5.0 RC5. But this change to the upstream
 containers caused it for some reason.

 > What happens if 6.9 doesn't include this change?

 If this is not merged into 6.9, then the unit tests will continue to fail.
 But I don't think there will be any noticeable impact otherwise because
 `getimagesize()` will just return the image size data, just with more than
 expected. Though I think it's preferable to include because it ensures the
 image type constant is consistent with the one added to PHP core for the
 release.

 > Are there more things that could pop up?

 It's possible, but I think the risk is very minimal. I searched the plugin
 directory, and while that site is a bit out of date, there
 [https://wpdirectory.net/search/01KBBJWSAW2X4D7XSGBJM7W0BW was not one
 reference to the constant] being changed in [61328].

 The scenario where someone may encounter an issue is if code is explicitly
 checking for the previous value of `99`. Something like this:

 {{{
 $image_size = wp_getimagesize( $filename );

 if ( '99' == $image_size[2] ) {
 // Do something HEIF/HEIC related.
 }
 }}}

 I searched for usage of `wp_getimagesize()` and
 [https://wpdirectory.net/search/01KBCATC081STZMVPJEF3MRGVT found 91
 results]. But none of those results are performing any logic checks using
 `IMAGETYPE_HEIC` or `IMAGETYPE_HEIF`.

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


More information about the wp-trac mailing list