Page 1 of 1

convert -distort MemoryAllocationFailed

Posted: 2010-10-21T09:13:52-07:00
by leemyongpak
I have ImageMagick 6.6.5-1 2010-10-19 Q16 on my CentOS 5 x86_64 hosting.
When using exec("convert ") from PHP with -distort option I always receive error message:

Code: Select all

convert: MemoryAllocationFailed `' @ fatal/cache.c/AcquirePixelCacheNexus/260
sometimes is

Code: Select all

convert: MemoryAllocationFailed `' @ fatal/hashmap.c/NewLinkedList/1411
while convert with other options like -resize or -thumbnail work well.

For example, when I use this simple PHP code

Code: Select all

exec("convert beaver.jpg -distort Perspective '0,0,34,0  0,140,0,109  140,0,183,115  140,140,170,236'   beaver_d.jpg");	
exec("convert beaver.jpg -thumbnail 200  beaver_thumb.jpg");
The first command returns error and cannot create image while the second one can.
Even when I use the simplest -distort: -distort SRT 0, it still returns convert: MemoryAllocationFailed error.
Anybody can help me?
Thanks.

Re: convert -distort MemoryAllocationFailed

Posted: 2010-10-21T10:27:50-07:00
by fmw42
do you know for sure that your are using that version of IM within PHP

try

exec("which convert")

and be sure you are getting the current version. The order of coordinates changed quite a while ago and perhaps you have an older IM that is looking for the other order (or it is an old version before -distort)

or try

exec("convert -version")

and see what it returns

Re: convert -distort MemoryAllocationFailed

Posted: 2010-10-21T10:56:54-07:00
by leemyongpak
Thanks for your quick reply.
You can see my imagemagik configuration here http://funphoto.it/choisy/test_config.php.
Other article on this forum tell that is the problem with openpm lib, but I need your advice before ask my host provider to disable openpm.