Upload Error

12 posts by 4 authors in: Forums > CMS Builder
Last Post: March 25, 2009   (RSS)

By pcolvin - March 22, 2009

I just started getting an upload error when uploading photos to a web site. The file size of the photo being uploaded is only about 500K. Just prior to getting this error, I uploaded several photos over 1 MB in size.

Here is a copy of the error:

Fatal error: Out of memory (allocated 47185920) (tried to allocate 15488 bytes) in /home/fdmjweb/public_html/cmsAdmin/lib/common.php on line 398.

Any help or guidance to fix this will be appreciated. I'm not sure if this is a CMS problem or server problem. As I mentioned it just started in the middle of some web site maintenance.

Re: [pcolvin] Upload Error

By pcolvin - March 22, 2009

After some further testing, I was able to get the uploads to work. I read on one of the posts that the image size may cause a problem. I changed the image size from 3872x2592 to 1024x768 and the uploaded worked. It seems that my problem was related to the image size, not the file size.

Something good to know if anyone else has the problem.

Re: [pcolvin] Upload Error

By Perchpole - March 22, 2009

Yes, I too would welcome some clarrification on this matter. It's very irritating to tell a client that they can upload any image so long as it's under "x megabytes" - only to have the upload fail because the physical dimensions of the image are too big.

So, can we either nail this problem or at least define where the lines are drawn otherwise we're going to have some explaining to do!

:0)

Perchpole

Re: [pcolvin] Upload Error

By Kenny - March 22, 2009

This is really a memory issue.

Because graphic manipulation can take large amounts of memory, the GD module will limit the size of the images. GD eats memory based on the dimensions of the image

I can't help but ask why a 3872x2592 image would need to be uploaded - that's a pretty big picture that wouldn't display in full on a 30-inch Apple Cinema HD Display.

I'm not sure of a work around -

Kenny

Re: [Perchpole] Upload Error

By Kenny - March 22, 2009

I see what you mean. I guess the only thing to do is to recommend to your client to resize the images before uploading straight from a digital camera.

Image resizing is one of the most CPU intensive tasks and therefore one of the most likely things to exceed CPU limits. I personally wouldn't want that to drag any of my servers down. I have a few photographers that chew up some memory during peak hours and the servers we have them on have 24GB RAM with Quad Core Processors. I can only imagine what it would do to a shared hosting environment.

We always recommend to our clients to download Irfanview http://www.irfanview.com to resize images. It's easy to use, FREE, and will batch resize and rename images without any problems.

I tell them to make sure their images are no greater than 800 pixels wide so they fit most monitors when viewed.

There are some alternatives to the GD Library but I'm not sure CMSB would work with them.

So in short, this is not a limitation of CMSB, but rather a limitation of your server.

Hey, next year at this time, we might be grumbling about needing more support for our hologram images. [;)]


Kenny

Re: [Perchpole] Upload Error

By Dave - March 23, 2009

I'll just add a official response that yes, image resizing is a memory intensive operation.

Things you can do include:
- Ask your host to increase your memory limit
- Try upload less images at a time (perhaps just one)
- Use the "Maximum upload size" setting in the field editor to reject extra large images.
- Disable thumbnail creation to reduce memory usage (but then you'd still have an extra large image.

The simplest may be to provide the client with some simple software or instructions to resize locally before uploading. We're always limited by the server resources the host provide, unfortunately.

That said, moving forward we're aware of this issue and will continue to research other solutions.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Upload Error

By Perchpole - March 23, 2009

Hi, Dave -

Thanks for your response (and your comments too, Sagnetic!). I now feel a bit more informed about this issue. I fully appreciate this isn't a problem with CMSB. Accordingly, I think I'll try to coax a few of my older clients to try a few rudimentary image adjustments before they upload!

Having said that, I think it must be worth exploring ways of capping large (dimension) images in much the same way that the system currently prevents heavy (MB) images from being uploaded. If this could be done, the end user would see a warning message from CMSB rather than some server-generated error message.

Do-able?

:0)

Perch

Re: [Perchpole] Upload Error

By Dave - March 24, 2009

Hi Perch,

I'd have to research, we may need to decompress the full image to get the dimensions, which is where the memory issue comes in.

What is the dimensions and filesize of the problem images? Is it possible to restrict just on filesize? Wouldn't very large images have a very large filesize?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Upload Error

By Perchpole - March 24, 2009


Wouldn't very large images have a very large filesize?



Hi, Dave ,

You would certainly think large images would have large filesizes but apparently that's not always the case - especially where digital cameras are concerned! My (somewhat elderly)client has been photographing his product range for years - in a certain way, with a particular camera, etc... So, if the resulting pictures cannot be uploaded, then the fault is mine - not his!

It's a pretty invideous position to be in!

Wibble!

Perch