convert: unable to write pixel cache

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
banause
Posts: 2
Joined: 2017-08-23T12:47:39-07:00
Authentication code: 1151

convert: unable to write pixel cache

Post by banause »

Linux
shell script
convert -version
Version: ImageMagick 6.8.9-8 Q16 i586 2017-01-03 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff webp wmf x xml zlib

Hi forum,

this is my first post here.
My network scanner sends tiff-files via ftp to a server on our LAN. The receiving directory there is being watched by inotifywait. If a new file is detected, processing starts (convert, tesseract, hocr2pdf and pdftk). This all works fine, except ...
except I do scan one of those documents, which do not go through. An double sided 8 pager today.
This line in the script

Code: Select all

convert $MYPATH/$FILENAME $TEMPPATH/$FILENAMEBASE-%d.tif 2>> $LOGFILE
leads to

Code: Select all

convert: unable to write pixel cache `/tmp/magick-16076PmTtKD2hpv3v': Auf dem Gerät ist kein Speicherplatz mehr verfügbar @ error/cache.c/WritePixelCachePixels/5451.
which means: not enough disk space on /tmp
I have checked and found 1.4GB free disk space which should be more than enough.

For situations where "unable to extend pixel cache" was the problem, I found a recommendation to do the following:

Code: Select all

# export MAGICK_MEMORY_LIMIT=20000000       ## 20MB
# env|grep MAGICK
MAGICK_MEMORY_LIMIT=20000000
# 
which brought about no changes as this seems to equal a limit of 20TB.

After I found this posting about units I changed my value to 20

Code: Select all

# export MAGICK_MEMORY_LIMIT=20
# env|grep MAGICK
MAGICK_MEMORY_LIMIT=20
# 
which, again, changed nothing.

Could anyone please have a look?

Thanks in advance,

banause
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: convert: unable to write pixel cache

Post by magick »

Either increase the free space on your temporary partition or set the MAGICK_TMPDIR environment variable to write to a path with plenty of free disk space. ImageMagick returns the exception you received when it runs out of free disk space.
banause
Posts: 2
Joined: 2017-08-23T12:47:39-07:00
Authentication code: 1151

Re: convert: unable to write pixel cache

Post by banause »

Thanks for helping so quickly.

Sometimes it is as easy as this. I would never have expected it to take 280MB per page (600dpi b/w tiffs).

Thank you!
Post Reply