Large or high DPI/Resolution image files are failing to process
Closed this issue · 1 comments
Image conversion can fail with something like this in the logs:
identify-im6.q16: width or height exceeds limit
/home/nunaliit/ikb_atlas/ikb/media/upl8653705240473774771.jpg' @ error/cache.c/OpenPixelCache/3839.`
In Ubuntu 18.04, the height and width limits are defined in /etc/ImageMagick-6/policy.xml
. Doubling the pixel and size limits worked around the problem. Would be nice to eliminate the ImageMagick dependency (tracked in issue #771).
We ran into this error again recently with some large images and to accommodate one that was 21645 x 6832 pixels, I set the following settings:
<policy domain="resource" name="width" value="22KP"/>
<policy domain="resource" name="height" value="22KP"/>
<policy domain="resource" name="area" value="484MP"/>
We then saw errors resembling:
identify-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
identify-im6.q16: cache resources exhausted `upl5856081140712146992.jpg' @ error/cache.c/OpenPixelCache/3984.
and altered this additional setting to resolve:
<policy domain="resource" name="disk" value="4GiB"/>
The values are resource limits so they should be set to reasonable values that will accommodate stuff you want to allow but not so high as to permit someone to bring your server to its knees. The KP values are dimensions in kilopixels. The area was set to the value obtained by multiplying the two. As for the disk value, I had to bump it up as well since allowing the larger images through then caused the system to hit a new resource limit.