Corrupted/double-exposure thumbnails when generated in parallel on ImageMagick 7 HDRI #19206
Unanswered
homecoded
asked this question in
Q&A / Support
Replies: 1 comment
-
|
Same issue here. Any ideas? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi commmunity!
I'm having a problem that I am unable to wrap my head around:
Description
When multiple thumbnails are generated in parallel, some output files contain pixel data from unrelated images. It looks almost like a "double exposure" effect where two different product images are merged together at a pixel/scanline level.
The errors are non-deterministic: the same source image produces slightly different corruption on each run. The frequency increases with the number of concurrent thumbnail generation requests.
Environment
Steps to Reproduce
Note: I was only able to reproduce the issue on our test and prod environment, but not locally.
Output format does not matter. WEBP, PNG and JPEG are affected.
Observations
MAGICK_THREAD_LIMITto 1 reduces but does not eliminate the errorsQuick Workaround
Generating thumbnails sequentially using a simple Imagick script works without issues:
I collected a list of all broken thumbnails in the frontend and put them into a list. I process the list by looking for the source file for each asset, and then I use the code above to convert the image.
Hypothesis
The corruption looks like pixel buffer bleed between concurrent PHP-FPM workers. I do not know how Imagick organizes its internal buffers but it must be something about ImageMagick 7 HDRI and ICC profile conversion (
profileImage()calls inImagick.php).Status
Currently running a full sequential thumbnail regeneration as an interim fix. Will update with results. It takes a day or two.
I'm a bit at a loss here. I tried most things I could think of. Next thing I am contemplating is writing my own thumbnail processing code, replacing Pimcore's. I hope it won't come to that. Any pointers on where the parallel processing issue originates in the adapter would be greatly appreciated.
Thank you!
Manuel
Beta Was this translation helpful? Give feedback.
All reactions