We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11186
    • 38 Posts
    I see posts all over the place regarding ’can’t upload images/create thumbnails larger than xMB’.

    It appears that GDlib bases memory use on the dimensions of the images it deals with and not so much the file-size.

    For example:

    In the mcpuck browser no thumbnails are created for large dimension images (although the upload is successful).

    In e2g, maxigallery, evogallery, and I suspect every other module or add-on using GDlib the upload fails.

    This is not a file-size issue. It happens with large resolution images uploaded from digital cameras. I’ve tried with files as small as 47K, yet it still runs out of memory (either trying to re-size the image or create a thumbnail of the image).

    No matter how much I increase PHP mem, it still tries to use all of it and craps out. For a 3000x3000 px image of a polar bear in a blizzard with a filesize of only 47K, it is ridiculous that I should need to set the PHP mem limit to 256M, just so it will successfully upload/create a thumbnail from a 47K file.

    I don’t see setting PHP mem limit to 256M or better as a solution. Even if I did upgrade the server with a ton of memory, I’d still have to hope that clients of many different sites on the same server didn’t upload their images at the same time.

    From what I’ve read ImageMagick doesn’t have this problem. Admittedly, I haven’t been able to test ImageMagick (I guess I could try phpthumb) because everything uses GDlib now (except phpthumb which gives you the option to use ImageMagick).

    I could ask clients to upload such images via FTP, but then any gallery add-ons/image browser wouldn’t be able to adjust to max sizes/resize/create thumbs images during upload. Which means I have to do it manually.

    I could ask clients to resize their images before uploading, but this only works with the few clients that have a clue. If they don’t have a clue then they have to send them to me and I have to do it manually.

    I could drop everything that uses GDlib, which means dropping mcpuck browser, which means drop Modx (is there an mcpuck browser alternative that uses ImageMagick?).

    I use Modx so that the client can manage their own site. If I have to intervene every time the client wants to do something as simple as upload an image from their camera, what do I need a CMS for again? I realize that’s a smarmy exaggeration, but really I spend a lot of time playing middle man to the Modx mcpuck browser/gallery mods that use GD in this area.

    So if anyone has any solutions or alternatives I’d love to hear them. If not, then consider this a heads up about GDlib and be prepared to manage the images manually for clients with new digital cameras.

    EDIT: My solution to this was to spend money upgrading RAM and setting the php memory limit sky high. Now all of the above mentioned plugins/mods work as expected for raw digi cam photo resolutions.