PDA

View Full Version : Fatal Error when adding images


Brad Lawryk
03-13-2010, 05:21 PM
Hi guys,

First time I have run into this .... when I try and add an image to a gallery I get:

Fatal error: Out of memory (allocated 32768000) (tried to allocate 319 bytes) in /homepages/35/d280850650/htdocs/perrysproimaging/visionsgallery/admin/common/functions.php on line 136

Any ideas?

Brad

Brad Lawryk
03-13-2010, 05:43 PM
This is the line that supposidly gives the error .....

$image_p = imagecreatetruecolor($w, $h);

Brad Lawryk
03-13-2010, 07:22 PM
Problem solved ......

Even the the image was under the max file size I still had to shrink the actual pixel dimensions of the image. Once I shrunk the pixel dimensions of the image down it worked fine.

Is this a bug?

Brad

Jason Byrnes
03-15-2010, 10:43 AM
this is a problem with the memory_limit setting on the PHP server.

Resizing the image on upload can be very memory intensive. even if the image is below the max file size setting, the memory required by the GD library may excede the memory_limit setting.

To increase the memory limit setting, add the following at line 1:
<?php ini_set('memory_limit', '256M'); ?>