Jump to content

[SOLVED] GD functions memory error


The Little Guy

Recommended Posts

Fatal error: Out of memory (allocated 73400320) (tried to allocate 4422 bytes) in /home/.marble/ryannaddy/beta.tzfiles.com/incl/db.php on line 111

 

 

function transparentGifShow($imageDirectory,$thumbDirectory, $imageName,$percent = 1){
$image = imagecreatefromgif("$imageDirectory/$imageName");
$details = getimagesize("$imageDirectory/$imageName");
$thumbHeight = $details[1] * $percent;
$thumbWidth = $details[0] * $percent;
$resized = imagecreatetruecolor($thumbWidth, $thumbHeight);
$colorTransparent = imagecolortransparent($image);
imagepalettecopy($image, $resized);
imagefill($resized, 0, 0, $colorTransparent);
imagecolortransparent($resized, $colorTransparent);
imagecopyresized($resized, $image, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $details[0], $details[1]);
imagegif($resized);
}

 

Line 111:    $resized = imagecreatetruecolor($thumbWidth, $thumbHeight);

 

Link to comment
https://forums.phpfreaks.com/topic/78022-solved-gd-functions-memory-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.