Bob Friesenhahn
2009-02-03 17:30:06 UTC
Here is an example of the gm command line that I am currently using
gm -convert "00000650.tif" -limit memory 1536mb -sample 2000x203771 -units PixelsPerPinch -density 400x400 -compress Group4 "new.tif"
gm convert: Image pixel limit exceeded (see -limit Pixels) (00000650.tif).
I also tried adding -limit pixels 3072MP and -limit pixels 4096 MP,
and the command still failed with the same message.
The command line is (mostly) evaluated in left to right order. Putgm -convert "00000650.tif" -limit memory 1536mb -sample 2000x203771 -units PixelsPerPinch -density 400x400 -compress Group4 "new.tif"
gm convert: Image pixel limit exceeded (see -limit Pixels) (00000650.tif).
I also tried adding -limit pixels 3072MP and -limit pixels 4096 MP,
and the command still failed with the same message.
the -limit option right after 'convert' and the problem should go
away.
You can also set the MAGICK_LIMIT_PIXELS environment variable using a
very large value so that you don't have to specify it on the command
line. You can set it for your Windows user account.
% gm convert -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 409.6MP (MAGICK_LIMIT_PIXELS)
% gm convert -limit pixels 3072MP -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 3.0GP (MAGICK_LIMIT_PIXELS)
% export MAGICK_LIMIT_PIXELS=3072MP
% gm convert -list resource
Resource Limits (Q16, 64 bits/pixel, 32bit address)
----------------------------------------------------
Disk: Unlimited (MAGICK_LIMIT_DISK)
File: 128 (MAGICK_LIMIT_FILE)
Map: 1.9GB (MAGICK_LIMIT_MAP)
Memory: 1.9GB (MAGICK_LIMIT_MEMORY)
Pixels: 3.0GP (MAGICK_LIMIT_PIXELS)
Note that for extremely wide images (which you don't have) it is
possible to run out of memory due to extremely long scanlines even if
the pixels limit is set very high.
Bob
======================================
Bob Friesenhahn
***@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/