ImageMagick cache resources exhausted

If you are trying to merge multiple images in a pdf you can use "convert" command, and probably will see the following message:

convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.

to enable this operation, you must edit the policy.xml file from ImageMagick. This file is located in /etc/ImageMagick-6/policy.xml (if the path doesn't exist, just write /etc/ImageMagick and press Tab).

Add the following line before </policymap>

<policy domain="coder" rights="read | write" pattern="PDF" />

Also, other common issue is the following:

convert-im6.q16: DistributedPixelCache '127.0.0.1' @ error/distribute-cache.c/ConnectPixelCacheServer/244.
convert-im6.q16: cache resources exhausted `source.jpg' @ error/cache.c/OpenPixelCache/3984.

To solve this, just increase the cache resources in disk value. Replace:

<policy domain="resource" name="disk" value="1GiB"/>

by

<policy domain="resource" name="disk" value="8GB"/>

Save the changes and enjoy it!

 



Comments

Popular posts from this blog

How to fix Android when developer options are not available for this user

Exception: Could not find a default OpenFlow controller in Mininet

v4l2: open /dev/video0: Permission denied