spacecatninja / craft-imager-x

Image transforms, optimizations and manipulations for your Craft CMS site.
Other
26 stars 16 forks source link

Uploaded images are rendered with gray areas #276

Open emmavanderhaeghen opened 5 days ago

emmavanderhaeghen commented 5 days ago
### I'm submitting a...

Description

Expected Behavior: Uploaded images should be processed and rendered fully without any gray areas.

Actual Behavior: Some images occasionally render with a gray block (see attached screenshots), appearing as if the rendering process was incomplete. I adviced my client to upload images who are less then 1MB for better performance, but some of the images they want to use are above 1MB.

Screenshot 2024-11-19 at 16 57 12 Screenshot 2024-11-19 at 16 57 18 Screenshot 2024-11-19 at 16 57 28 Screenshot 2024-11-19 at 16 58 08

How can it be avoided that these gray areas appear when uploading new images? Could the problem be the file size of the images? Or could the problem be somewhere else?

Additional info

aelvan commented 2 days ago

This is almost certainly due to PHP/connections timing out one way or another. Imager adds as much safeguards as it can, but some scenarios can't be mitigated. Are you using external storages, ie AWS S3, DigitalOcean Spaces, or similar?

The only advice I can give is to increase timeout limits, most notably max_execution_time in PHP, request_terminate_timeout if you're using PHP-FPM with nginx, and also fastcgi_read_timeout when using nginx. This issue is probably not due to memory constraints, but there's a slim chance that increasing memory limits also could be beneficial. Also, generate as many transforms as possible up front, as long as you have a working queue running, it's less likely to cause these kinds of timeouts.

Hope this helps.