[13.x] Add HEIC and additional AVIF support - #60922
Merged
Merged
Conversation
|
Thanks for submitting a PR! Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
riasvdv
marked this pull request as ready for review
July 29, 2026 08:30
zachiler
added a commit
to zachiler/framework
that referenced
this pull request
Aug 3, 2026
Image::dimensions(), width() and height() read the size with getimagesizefromstring(), which misreads HEIC: it returns false for large grid/tiled HEICs (so those methods throw) and reports the coded/padded frame size for smaller ones. For HEIC/HEIF, dimensions are now read from the driver, which decodes the image and reports its true display size, falling back to the native reader when the driver can't decode the image (e.g. the GD driver). Every other format is unchanged. Adds dimensions() to the Image\Driver contract and InterventionDriver, mirroring dominantColor(). Follow-up to laravel#60922. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
zachiler
added a commit
to zachiler/framework
that referenced
this pull request
Aug 4, 2026
Image::dimensions(), width() and height() read the size with getimagesizefromstring(), which misreads HEIC: it returns false for large grid/tiled HEICs (so those methods throw) and reports the coded/padded frame size for smaller ones. For HEIC/HEIF, dimensions are now read from the driver, which decodes the image and reports its true display size, falling back to the native reader when the driver can't decode the image (e.g. the GD driver). Every other format is unchanged. Adds dimensions() to the Image\Driver contract and InterventionDriver, mirroring dominantColor(). Follow-up to laravel#60922. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Illuminate\Imagecurrently exposes AVIF output throughImage::toAvif(), but rejects AVIF inputs before they reach Intervention Image. HEIC and HEIF inputs are rejected in the same way, and HEIC output is not exposed despite Intervention providing an encoder. This adds first-class AVIF input and HEIC input/output support.Image::toHeic()Image::optimize('heic')Image::optimize('heif'), normalized to HEIC outputimagevalidation ruleAlso updates
Image::extension()to recognize AVIF and HEIC/HEIF MIME aliases. HEIF output aliases are normalized to the canonical.heicextension andimage/heicMIME type. HEIC processing requires an Imagick installation with HEIC codec support.