Problems with thumbnailImage function

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
btgmarco
Posts: 1
Joined: 2011-11-22T11:24:08-07:00
Authentication code: 8675308

Problems with thumbnailImage function

Post by btgmarco »

The function thumbnailImage, is presenting a problem on my server, running the latest version ImageMagick 6.7.1-9 2011-11-18 Q16 with release date 2011-11-18, he is presenting the followings errors:

---------------------------------------xxxx-------------------------------------------------
MemoryAllocationFailed `' @ fatal/cache.c/AcquirePixelCache/190
Premature end of script headers: php5
---------------------------------------xxxx-------------------------------------------------
php: UnableToAcquireString `' @ fatal/string.c/AcquireString/127
Premature end of script headers: php5
---------------------------------------xxxx-------------------------------------------------
php: UnableToAcquireString `' @ fatal/string.c/AcquireString/127 (process: 20355 ): GLib - ERROR (recursed) **
gmem.c:154: failed to allocate 2032 bytes
aborting...

[notice] EACCELERATOR(20355): PHP crashed on opline 78 of thumbnailimage() at
path:388

Premature end of script headers: php5
---------------------------------------xxxx-------------------------------------------------

I´m pretty sure that memory it´s not the problem, once the server has 1GB ram memory free, and 2GB free on the SWAP memory, and 27GB on the hard disk... this system is enough to fully the requirements to resize an image with 500kb and 1024x768 , and also, I do know the problem is not the php script, because on another server the script works fine, the difference is only the version is ImageMagick 6.7.1-9 2011-08-22 Q16

I already lost two days searching for an answer to this problem , i will be very grateful with any light on this problem.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problems with thumbnailImage function

Post by magick »

The script is running out of memory. PHP can restrict the amount of memory a process can consume. Check your php.ini configuration file. You could force ImageMagick to process the pixels on disk by reducing the memory limits. From the command line, use '-limit memory 2MB' for example. Or use the MAGICK_LIMIT_MEMORY environment variable.
Post Reply