Skip to content

[6.x] Support Glide 4 and Intervention Image 4 - #15019

Merged
jasonvarga merged 6 commits into
6.xfrom
glide-4-intervention-image-4
Jul 16, 2026
Merged

[6.x] Support Glide 4 and Intervention Image 4#15019
jasonvarga merged 6 commits into
6.xfrom
glide-4-intervention-image-4

Conversation

@joshuablum

@joshuablum joshuablum commented Jul 16, 2026

Copy link
Copy Markdown
Member

Laravel 13.20 added first party image processing (laravel/framework#59276), which requires intervention/image v4. Statamic uses Glide and our usage of league/glide ^3.0 pins intervention/image to ^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 new Image API 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 Laravel Image API. 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:

v3 v4
$manager->read() decodeBinary()
$manager->create() createImage()
$image->pickColor() colorAt()
$image->blendTransparency() fillTransparentAreas()
$image->encodeByExtension() encodeUsingFileExtension()

orient(), crop(), width(), height(), fill() and DriverInterface::supports() are identical in both, so ImageValidator's logic is untouched.

Introducing a small Statamic\Imaging\Intervention class 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 your composer.json if you need to remain on v3.

@joshuablum
joshuablum requested a review from a team as a code owner July 16, 2026 16:04
@jasonvarga
jasonvarga merged commit 903f963 into 6.x Jul 16, 2026
23 checks passed
@jasonvarga
jasonvarga deleted the glide-4-intervention-image-4 branch July 16, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants