Jump to content

Fatal error: Out of memory


steviez

Recommended Posts

Hi,

 

I am trying to upload and resize an image on my server but i am getting an out of memory error. My php limit is 64M so i dont see why it wont work.

 

My Code:

 

<?php
case "jpg":
      $file = imagecreatetruecolor($width, $height);
      $new = imagecreatefromjpeg($this->file_tempname);
      for($i=0; $i<256; $i++) { imagecolorallocate($file, $i, $i, $i); }
      imagecopyresampled($file, $new, 0, 0, 0, 0, $width, $height, $this->file_width, $this->file_height);
      imagejpeg($file, $photo_dest, 60);
      imagedestroy($new);
      imagedestroy($file);
      break;
?>

 

any ideas?

Link to comment
https://forums.phpfreaks.com/topic/179856-fatal-error-out-of-memory/
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.