aivus/sonata-media-fixed-dimensions-resizer
inset/outbound), with no hooks for custom logic (e.g., progressive resizing, format conversion).EventDispatcher, Filesystem).spatie/laravel-medialibrary)—requires a wrapper layer to bridge SonataMedia’s Symfony-centric architecture.^8.0 support).EventDispatcher)?intervention/image, spatie/image-optimizer) be a better fit for fixed aspect ratios?fit, crop) is insufficient.composer.json (with ^1.0 constraint due to lack of updates):
composer require aivus/sonata-media-fixed-dimensions-resizer
config/packages/sonata_media.yaml:
sonata_media:
resizers:
fixed_inset:
type: aivus.sonata.media.resizer.fixedDimensions.inset
width: 120
height: 120
fixed_outbound:
type: aivus.sonata.media.resizer.fixedDimensions.outbound
width: 120
height: 120
services.yaml or provider classes).MediaPostPersist) to Laravel’s Model::saved().Storage facade to replace Symfony’s Filesystem.spatie/laravel-queueable-media) to avoid sync blocking.sonata-project/media-bundle: "*" (test compatibility with your version).EventDispatcher, Filesystem, and DependencyInjection—may need polyfills for Laravel.fit resizer if errors occur).Container, scaling may require sticky sessions or caching.memory_limit). Test with production-scale files.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| SonataMediaBundle update breaks compatibility | Resizers fail silently | Pin SonataMediaBundle version; implement fallback resizers. |
| PHP version incompatibility | Resizing fails with errors | Use Docker/PHP-FPM with compatible version; patch if critical. |
| Large image crashes PHP worker | Out-of-memory (OOM) kills | Set higher memory_limit; implement chunked resizing or queue |
How can I help you explore Laravel packages today?