Image Upload: Warning: Division by zero

4 posts by 3 authors in: Forums > CMS Builder
Last Post: April 20, 2010   (RSS)

Hi, we just started getting this error for a few images:

Warning: Division by zero in /home/luxurychartergroup/luxurychartergroup.com/cms/lib/menus/default/common.php on line 142

Could it be corrupt images as its only a few of them that have issues. I have attached two of the suspect images.

FYI, I did find a reference to this error in an earlier post here: http://www.interactivetools.com/forum/gforum.cgi?post=75029;search_string=Warning%3A%20Division%20by%20zero;#75029

We did upgrade to version 2.03 recently as well.

Re: [aquaman] Image Upload: Warning: Division by zero

By Jason - April 16, 2010

Hi,

Yeah, that's an interesting one. It definitely seems to be an issue with the images, as I wasn't able to upload them either. However, I found a work around:

-open the image in an image editor
-select the entire image and copy it.
-open a new image file
-paste in the image and save it under a new name.

You should be able to upload that image now. Let me know if that works for you.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [chris] Image Upload: Warning: Division by zero

By Chris - April 20, 2010

Hi aquaman,

Unfortunately, my "workaround" was crashing Apache when I uploaded certain files. Crashing webservers is generally considered bad form, so I'm abandoning that approach.

The problem comes down to certain Canon cameras and PHP, as bizarre as that may seem.

The next beta of CMS Builder will no longer suffer a "division by zero" error when a corrupt JPEG is uploaded, but such photos will not be thumbnailed and their heights and widths will not be known.

Sorry we couldn't be of more help. Please let us know if you have any questions.
All the best,
Chris