convert -distort MemoryAllocationFailed

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
leemyongpak

convert -distort MemoryAllocationFailed

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert -distort MemoryAllocationFailed

Post 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
leemyongpak

Re: convert -distort MemoryAllocationFailed

Post 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.
Post Reply