I've got some code that, eventually, will resample a JPG to a new size. I'm finding however that my code is halting without error at my imagecreatetruecolor call.
Code: Select all
echo "about to imagecreatetruecolor with $reqWidth, $reqHeight";
// create a new image for the result
$destImgResource = imagecreatetruecolor( $reqWidth, $reqHeight )
or die( "imagecreatetruecolor $reqWidth, $reqHeight failed." );
echo "after imagecreatetruecolor";
The code to do the image resampling is in a function, in a class, tucked in a library I authored and include in my path. I found that upping the memory limit at the top of the function that does the resampling solves the problem. It really doesn't seem like so much memory would be consumed for my images, but I guess one should always do some memory checks when things like this start happening. I use the Zend AutoLoader, and I imagine there's a lot of memory consumed just loading PHP code. By the time my image resampling code comes along, there may not be much left.
Word to the wise. memory_get_usage() is your friend in times like this.
HH.