[Magick-bugs] convert -rotate fails on large images

duc.sequere.aut.de.via.decede at imagemagick.org duc.sequere.aut.de.via.decede at imagemagick.org
Tue Mar 3 00:59:11 UTC 2009


> The pdf->jpg conversion fails on linux due to memory issues

See http://www.imagemagick.org/script/architecture.php#cache for insight
into how ImageMagick allocates memory.  You can trade memory usage for
disk space with the following command:

  convert -limit memory 128mb -limit map 256mb image.pdf -rotate 90 image.jpg

With this command, pixels are processed on disk reducing memory usage
but slowing down the process because disk is much slower than memmory.
The process will complete though as long as you have plenty of free disk
space.  By default, under Linux temporary space is allocated at /tmp.
You can change this with an environment variable.  Suppose you have
plenty of free space at /data.  Use these commands:

  export MAGICK_TMPDIR /data
  convert -limit memory 128mb -limit map 256mb image.pdf -rotate 90 image.jpg

If the cores idle just be patient.  ImageMagick is trading disk I/O for
memory I/O.

You may have better luck with recent releases of ImageMagick which supports
parallel processing on multiple cores.


More information about the Magick-bugs mailing list