Closed chimit closed 10 months ago
Absolutely similar situation PHP 8.2.7 spatie/laravel-medialibrary 10.10.1
Have you installed the file convertors on your server?
sudo apt install jpegoptim optipng pngquant gifsicle
npm install -g svgo
@Cigoler yes, I have them.
The generated_conversions
field is empty for such images if it helps in investigation.
INSERT INTO `media` (`id`, `model_type`, `model_id`, `uuid`, `collection_name`, `name`, `file_name`, `mime_type`, `disk`, `conversions_disk`, `size`, `manipulations`, `custom_properties`, `generated_conversions`, `responsive_images`, `order_column`, `created_at`, `updated_at`)
VALUES
(26243, 'App\\Models\\Listing', 443, '2c41472b-fd00-4e76-ba9d-d9b035492339', 'shared', 'photo', 'photo.jpeg', 'image/jpeg', 'media', 'media', 12818732, '[]', '[]', '[]', '[]', 1, '2023-08-21 05:16:31', '2023-08-21 05:16:52');
Same here using php 7.4
and ^8.7
not all but some photos are not generated
Can anyone help ?
Since there aren't too many complaining about this, I'm assuming it's caused by something at your end. Moving this to a discussion.
I use Redis queues (via Horizon) to generate conversions (
small
,medium
, andlarge
). Images are stored in S3 (DigitalOcean Spaces). Everything works fine but sometimes conversions are not generated. And there are no clues because in Horizon such jobs look successful:One of the skipped examples:
In DO Spaces there is one original file without conversions.
The only suspicious thing here is the duration of the job - it's too short comparing other successful conversions. So I can only guess something wrong happens during the conversion and medialibrary is unaware of these failures, marking such jobs as done. Or medialibrary for some reason mistakenly thinks there is nothing to convert for some images and skips the job.
Running
php artisan media-library:regenerate --only-missing
successfully regenerates such missing conversions.