[6.x] Support Glide 4 and Intervention Image 4 - #15019
Merged
Merged
Conversation
jasonvarga
approved these changes
Jul 16, 2026
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.
Laravel 13.20 added first party image processing (laravel/framework#59276), which requires
intervention/imagev4. Statamic uses Glide and our usage ofleague/glide ^3.0pinsintervention/imageto^3.9.1. Since you can't use two versions of a package at the same time, anyone on Laravel 13.20+ who would reach for the newImageAPI would get an error.Laravel's change introducing the feature doesn't break any existing Statamic sites which is good. This only affects people who want to use the new feature.
The PR widens the constraint to
league/glide: ^3.0 || ^4.0. Glide 4 migrated to Intervention Image v4, so allowing it is what allows to use LaravelImageAPI. This means nobody is forced to upgrade but requires a small version check/compatibility layer. The Glide API between v3 and v4 is unchanged for everything we use but Intervention requires some adjustments:$manager->read()decodeBinary()$manager->create()createImage()$image->pickColor()colorAt()$image->blendTransparency()fillTransparentAreas()$image->encodeByExtension()encodeUsingFileExtension()orient(),crop(),width(),height(),fill()andDriverInterface::supports()are identical in both, soImageValidator's logic is untouched.Introducing a small
Statamic\Imaging\Interventionclass which can be removed when we eventually drop Glide v3 with Statamic 7(?).This also fixes a latent break in
GlideServiceProvider, which called$imageManager->driver(). v4 doesn't have that method but it's a public property instead. The validator's driver is now built directly.Dependency note
If you are calling Intervention methods manually in app code or addon code, now that we are allowing intervention v4, technically your code could break as v4 would get installed where you're expecting v3.
If you're calling Intervention directly, you should have been explicitly requiring it. But it works without doing it. It's a common mistake - one we're resolving in this PR ourselves.
Add
"intervention/image": "^3.9.1"to yourcomposer.jsonif you need to remain on v3.