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.
Props westonruter, skithund, johnbillion, adamsilverstein.
Fixes #64322.