I create thumbnails traveling across a multitude of images when I find a large image that I get:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 13056 bytes)
Now I already know how to get around this with:
ini_set('memory_limit', '-1');
I want to know why he runs out of memory! Are there any debugging tools that will show me when my memory is running out? And in particular, this will show me if there are variables / arrays that kill my memory?
OR, is there a better way to resize other images:
$thumb=imagecreatetruecolor($newwidth,$newheight);
$source=imagecreatefromjpeg($imgfile);
imagecopyresampled($thumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
imagejpeg($thumb,$destinationfile,85);
?
Many thanks!
source
share