[wp-trac] [WordPress Trac] #64322: PHP 8.5: HEIF/HEIC support added to `getimagesize()`
WordPress Trac
noreply at wordpress.org
Mon Dec 1 14:27:20 UTC 2025
#64322: PHP 8.5: HEIF/HEIC support added to `getimagesize()`
-------------------------------------------------+-------------------------
Reporter: desrosj | Owner: desrosj
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 6.9
Component: Media | Version:
Severity: normal | Resolution: fixed
Keywords: php php85 has-patch dev-feedback | Focuses: php-
fixed-major | compatibility
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):
* status: reopened => closed
* resolution: => fixed
Comment:
In [changeset:"61334" 61334]:
{{{
#!CommitTicketReference repository="" revision="61334"
Media: Adjustments for official HEIF/HEIC support in added in PHP 8.5.
Now that a version of `imagick` with support for PHP 8.5 has been released
and the containers maintained by the project for the local development
environemnt have been updated to include it, there are some new PHP 8.5
compatibility issues that have surfaced related to HEIF/HEIC image format.
PHP 8.5 added support for the HEIF/HEIC image format in `getimagesize()`.
To properly support this in a cross-version way, a few changes are
necessary.
Since [58849], WordPress has supported this format and the
`IMAGETYPE_HEIC` constant was introduced as a placeholder until proper
support was added in PHP. Since that has now happened, this constant needs
to be changed to contain a value of `20` instead of `99`, and the name
upstream was added as `IMAGETYPE_HEIF`. The constant in Core is being
changed to match those included in PHP.
The implementation for this image format in `getimagesize()` also follows
a similar pattern to that of AVIF where additional information such as the
image `bits` and `channels` are also returned. This additional information
is causing unit tests to fail. The tests have been updated to account for
different versions of PHP returning a different level of detail.
Follow-up to [58849].
Reviewed by desrosj, SergeyBiryukov.
Merges [61328] to the 6.9 branch.
Props westonruter, skithund, johnbillion, adamsilverstein.
Fixes #64322.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64322#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list