ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

EE 2.2.2: Upload large PNG gives memory error, but not when JPG...

November 12, 2011 4:30am

Subscribe [3]
  • #1 / Nov 12, 2011 4:30am

    mhulse

    329 posts

    It mus be my server, but…

    When uploading a 5128px X 300px PNG, via an entry upload, I get this error:

    PHP Fatal error: Out of memory (allocated 14680064) (tried to allocate 4615200 bytes)

    The error points to “Image_lib.php” as the problematic PHP file.

    I have this in my php.ini:

    memory_limit = 128M

    I double checked with host and they are do allow 128M for that setting.

    Things I have noticed:

    1. Even though I get the error, the file still uploads but the thumbnail does not generate and the file synchronize does not recognize this uploaded file.

    2. If I convert the PNG to a JPG, I can upload without error.

    Does this sound like a problem with my server?

    Thanks!
    Micky

  • #2 / Nov 12, 2011 8:51am

    Rob Allen

    3105 posts

    It sounds as if the server is strugging to process the image thumbnails because it hasn’t got enough memory to process such a large image (5000px and probably a very large file size). A .jpg would be a far smaller file size than a .png which may explain why that format is ok.

    Have you tried bumping your server memory up to 256m or even 512m?

  • #3 / Nov 13, 2011 12:49am

    mhulse

    329 posts

    Hi Blue Dreamer! Thank you so much for your reply and help, I really appreciate it! 😊

    It sounds as if the server is strugging to process the image thumbnails because it hasn’t got enough memory to process such a large image (5000px and probably a very large file size). A .jpg would be a far smaller file size than a .png which may explain why that format is ok.

    That’s a good point. I did check the file size of the PNG and it’s at 1.1MB; the jpg comes in at half that file size.

    To me, that seems pretty small in file size?

    Hmmm, IIRC, isn’t there a way to tell EE what image lib to use? Maybe I could switch to a diff library?

    Have you tried bumping your server memory up to 256m or even 512m?

    I have not tried that yet… I think my host limits the memory I can allocate to 128 MB. I will tinker with that setting in my PHP.ini to see if it helps.

    You know, now that I think about it, I don’t mind using a jpg for these larger graphics; I probably should not have bugged anyone with this question.

    Anyway, thanks so much for your pro help! I greatly appreciate it. 😊

    Have a great Sunday.

    Cheers,
    Micky

  • #4 / Nov 13, 2011 12:54pm

    Sean C. Smith

    3818 posts

    mhulse,

    Which image library are you using? I did a quick google search and it seems that imagemagick is better at resizing large images than GD or GD2. could you go to

    admin > system administration > Image Resizing Preferences and choose Image Magick if it’s available and see if that resolves your issue?

    Once you’ve done that please post back with the results.

    Sean

  • #5 / Nov 14, 2011 11:48pm

    mhulse

    329 posts

    Hi Sean! Thanks so much for you help, I really appreciate it.

    Great tip! I probably should have googled more before posting, sorry about that. :(

    I contacted my host, and ImageMagick is not installed; fortunately, I think my host is going to install it for me as long as it does not cause any problems for other clients on the same machine.

    It sounds like the problem is with my PHP memory and/or the image lib module… I think I can start poking sticks in other forums, so feel free to close this thread out. :D

    Thanks to everyone for the help, I really appreciate it.

    Cheers,
    Micky

  • #6 / Nov 15, 2011 11:03am

    Sean C. Smith

    3818 posts

    mhulse,

    Awesome - glad to hear you resolved it with your host. Feel free to post again as needed.

    Sean

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases