Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Hey everyone, question for those of you out there that are geniuses (I'm a newbie to IM). I am running ImageMagick-6.5.4.7-5.el6.x86_64 and CentOS 6.0 Final. When running a script to create thumbnails, I am getting the following errors:
$thumb=new Imagick($local_path);
$thumb->flattenImages();
$thumb->setImageColorspace(Imagick::COLORSPACE_SRGB);
//Scale the image
$thumb->thumbnailImage(128,128,true,false);
$thumb->setImageFormat("png");
$thumb->stripImage();
//Write the new image to a file
$thumb->writeImage('/home/metathumbs/'.$image_data->thumb);
When I look in to the error a little bit more, line 1035 in ImageMagick is something to do with the layers in the photo.
Examples can be gotten here (File size is 46MB compressed):
Perhaps you need to increase the maximum amount of memory a script may consume for PHP. The default may be as low as 8MB. In our php.ini script file, we use
memory_limit = 128M
If you cannot increase the limit, set your memory resource limit to say 2MiB (not sure how this is done in IMagick, from the command line its -limit memory 2MiB). If an image or a set of images exceed this limit, all subsequent images are cached to disk to reduce the memory resource consumption.
magick wrote:Perhaps you need to increase the maximum amount of memory a script may consume for PHP. The default may be as low as 8MB. In our php.ini script file, we use
memory_limit = 128M
If you cannot increase the limit, set your memory resource limit to say 2MiB (not sure how this is done in IMagick, from the command line its -limit memory 2MiB). If an image or a set of images exceed this limit, all subsequent images are cached to disk to reduce the memory resource consumption.
I have already done this. My memory is at, I believe, 256M. The issue is not with the size, because I have larger images that process fine, for instance 84MB that process through normally, with no errors.