zenstruck/imagine-extra-bundle
A Symfony bundle that adds extra filters and utilities to the Imagine image manipulation library, making it easy to apply additional image transformations through configuration and services.
Architecture fit
Kernel, DependencyInjection container, bundle registration in AppKernel.php, and YAML service/filter configuration. Laravel has no bundle loader; a Symfony bundle cannot be registered from a ServiceProvider without pulling in a large slice of the Symfony framework that Laravel does not ship.imagine-filters library (same author, kbond) into the DI container. The image-manipulation work is done by Imagine, which is itself a legacy dependency in the PHP ecosystem. Nothing in the bundle is Laravel-aware — no facades, no config publishing, no filesystem/queue integration, no Storage adapter.intervention/image, spatie/image, league/glide) with first-class Storage, queue, and config support.Integration feasibility
symfony/* to 2.x-era ranges and PHP to 5.x. Forcing it requires --ignore-platform-reqs plus a forked constraint set, which is a red flag before any code runs.imagine-filters directly (if the filter semantics are genuinely needed), or better, reimplement the handful of filters on a maintained library. At that point the package is a reference implementation, not a dependency.Technical risk
each(), create_function(), dynamic properties on non-#[AllowDynamicProperties] classes, and松散 argument ordering that PHP 8 rejects or deprecates to errors.intervention/image is the maintained Laravel answer. Choosing this package means choosing the one option with no successor and no maintainer.Key questions
intervention/image or spatie/image in under a day?Verdict: Reject as a dependency. Treat it as a specification artifact — mine the YAML filter chains, reimplement on a maintained library, and do not add it to composer.json.
Stack fit
Extension/Configuration DI semantics, services.yml tagging, and event-dispatcher wiring tied to Symfony's kernel lifecycle. Laravel's container, config repository, and filesystem abstraction have no bridge to these.intervention/image (Laravel-native, actively maintained, Storage-friendly) or league/glide if you want URL-driven, stateless transforms. Neither needs a bundle.league/glide + a Laravel route/controller is a cleaner fit than anything derived from this bundle.Migration path
config/images.php) consumed by a FilterRegistry service. This config is the durable asset; the library underneath is swappable.ImageTransformer::apply(string $profile, $image): $path) so the underlying library is an implementation detail. This is the single most important decision; it makes any future library swap a one-file change.Compatibility
Imagick/GD API drift, and replacing any Symfony 2 event dispatcher usage.Sequencing
| Phase | Work | Exit criterion |
|---|---|---|
| 0 | Confirm no production usage; snapshot config | Written filter inventory |
| 1 | Choose target library (intervention/image recommended) |
ADR approved |
| 2 | Build FilterRegistry + adapter interface |
Unit tests on config parsing |
| 3 | Parity harness on representative corpus | ≥ 98% perceptual match |
| 4 | Shadow-run in staging | Two weeks clean |
| 5 | Cut over, remove legacy references | Bundle absent from lockfile |
Maintenance
Support
Scaling
memory_limit per worker and hard input-size caps.sha1(source + profile + version)) on a CDN-backed disk. Include the filter-config version in the key so a config change invalidates cleanly rather than serving stale derivatives.Failure modes
gd or imagick in the runtime; fails at first transform, often in production because dev images lacked it. Add a boot-time capability check to the health endpoint.file_get_contents, path join, and remote URL fetch.Ramp-up
How can I help you explore Laravel packages today?