spatie / laravel-medialibrary

Associate files with Eloquent models
https://spatie.be/docs/laravel-medialibrary
MIT License
5.78k stars 1.08k forks source link

When regenerating responsive images get wiped out. #3557

Closed inalto closed 8 months ago

inalto commented 8 months ago

How to reproduce: You have multiple media images with responsive, the responsive images are generated in the same output directory because they are generated in a path like this:

origin: private/name/responsive-{n}.jpeg

output: user/name/images/responsive-{n}preview{width}_{height}.webp

in such scenario if a regenerate is done like this:

php artisan media-library:regenerate --ids=42860,42861,42862

on the output dir only the last responsive image will be available, because when each media id is generated it is wiping all previous generated images