Problem With Larger Image Uploads

I have a problem uploading some images.

If I try to upload an image of 2.5mb and dimensions of 4000 x 3000 it will not upload and just goes to a 'HTTP 500 Internal Server Error' Page at action/file/upload. It does not even show an 'upload failed' error.

If I try to upload an image of 7 mb and dimensions of 3444 x 2287 it will upload OK.

I changed the .ataccess file to # upload_max_filesize is the maximum size of a single uploaded file (10 MB) but is there a setting for the maximum dimensions of an image or something?    

  • 3600 x 2700 = 9,720,000

    4000 x 3000 = 12,000,000

    The "smaller" image (based on file size) has a larger memory requirement for resizing (assuming same color resolution and same number of color channels for both images). For the memory requirement of the GD library the file size is not relevant. It's the image resolution and bits used per channel to store color resolution and the number of color channels. In Tidypics I introduced the following check to make sure there's enough free memory:

    $requiredMemory1 = ceil($imginfo[0] * $imginfo[1] * 5.35);
    $requiredMemory2 = ceil($imginfo[0] * $imginfo[1] * ($imginfo['bits'] / 8) * $imginfo['channels'] * 2.5);
    $requiredMemory = (int)max($requiredMemory1, $requiredMemory2);

    For example you can have 32 bits color resolution and normally you have 4 channels. Plus you will have some uncertaincy about possible overhead and you might need two copies of the same size of the image in memory.

  • I have just noticed that when I try to upload it using file upload section it goes to the 500 error page but it is uploading because when I go into my uploaded files section it is there. But there is no thumbnail.

    When I try to upload it using avatar upload it goes to the 500 error page (/action/avatar/upload) and I have to press the back button to return to the avatar upload page which has no image.


  • @JohnnyD the problem is not with image upload even if you upload 100MB picture, the problem is with elgg thumbnail generator.


  • I have just changed the php settings on my server to memory_limit 128m and it is all working fine now.

    Both avatar uploads and file uploads of an image of 4mb with dimensions of 4000px x 3000px uploaded and the thumbnail is now showing on file uploads as well.

    I was just about to give up!!

    Thanks everyone for all your help.

  • Just tested it with a 6.76mb image with dimensions of 5184 x 3456 and again it uploaded fine with thumbnail.

    That's another day I wont get back. All good fun though.

    Does anyone know a good reference for server configuring for elgg ? 

    Thanks again.