Page History
...
If you wish to re-enable ImageMagick to process Ghostscript format types, you can simply comment out those lines in the configuration file. Be aware that, as the fix to this vulnerability is not yet verified, you should only do so at your own risk.
"convert-im6.q16: cache resources exhausted" errors
On Debian, and possibly other OSes, you may see errors like these when attempting to generate video thumbnails (especially if video files are big):
Code Block |
---|
File: video.mp4.jpg
ERROR filtering, skipping bitstream:
Item Handle: 1234/5678
Bundle Name: ORIGINAL
File Size: 146761357
Checksum: 735ceb1b6b249afc84a5bb1b87ae0c02 (MD5)
Asset Store: 0
org.im4java.core.CommandException: convert-im6.q16: cache resources exhausted `/tmp/magick-64dziU-1nQJjQHZYu4_R1fFP4l9en5iL.pam' @ error/cache.c/OpenPixelCache/4095. |
These may be caused by too conservative resource policies in your policy.xml
file. As an example, default values are located at /etc/ImageMagick-6/policiy.xml
in Debian 11 (Bullseye), and are:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<policymap>
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<policy domain="resource" name="memory" value="256MiB"/>
<policy domain="resource" name="map" value="512MiB"/>
<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>
<!-- <policy domain="resource" name="list-length" value="128"/> -->
<policy domain="resource" name="area" value="128MP"/>
<policy domain="resource" name="disk" value="1GiB"/> |
To avoid the cache resources exhausted
error, try increasing the resource limits policies. You may want to start by increasing the memory
and disk
policies (disk cache is used when the memory limit is reached). The actual values have to be adjusted depending on the size of your video bitstreams and the actual resources available in your installation. For example:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<policymap>
<!-- <policy domain="resource" name="temporary-path" value="/tmp"/> -->
<policy domain="resource" name="memory" value="2GiB"/>
<policy domain="resource" name="map" value="512MiB"/>
<policy domain="resource" name="width" value="16KP"/>
<policy domain="resource" name="height" value="16KP"/>
<!-- <policy domain="resource" name="list-length" value="128"/> -->
<policy domain="resource" name="area" value="128MP"/>
<policy domain="resource" name="disk" value="4GiB"/> |
For a detailed description of the ImageMagick limits, see https://imagemagick.org/script/command-line-options.php#limit.
Once the limits are properly set, a successful execution of the filter should show a message similar to:
Code Block |
---|
File: video.mp4.jpg
FILTERED: bitstream 12345678-abcd-efgh-ijkl-1234567890ab (item: 1234/5678) and created 'video.mp4.jpg' |