Hi everyone,

this is abit of a strange bug/problem because the module works fine and the images are resize exactly as expected.

The problem is when i go to add an image i get the following at the top of the page:
"warning: Division by zero in /var/www/html/v/modules/image_exact.module on line 66."

this is line 66: "$source_ar = $source_info['width'] / $source_info['height'];"

It doesn't happen when editting an image just when you add a new one.

advice to solve this would be great!

thanks
Tom

Comments

klcthebookworm’s picture

Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev

I'm having this same issue with 4.7.0

Here's all the error messages I'm getting

* warning: Division by zero in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/modules/image_exact/image_exact.module on line 89.
* warning: Division by zero in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/modules/image_exact/image_exact.module on line 91.
* warning: Division by zero in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/modules/image_exact/image_exact.module on line 91.
* warning: imagecreatetruecolor(): Invalid image dimensions in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 269.
* warning: imagecopy(): supplied argument is not a valid Image resource in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 270.
* warning: imagejpeg(): supplied argument is not a valid Image resource in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 300.
* warning: imagedestroy(): supplied argument is not a valid Image resource in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 273.
* warning: imagecreatetruecolor(): Invalid image dimensions in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 225.
* warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 226.
* warning: imagejpeg(): supplied argument is not a valid Image resource in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 300.
* warning: imagedestroy(): supplied argument is not a valid Image resource in /home/bookworm/public_html/cms_test/Drupal/drupal-4.7.0/includes/image.inc on line 229.

cog.rusty’s picture

I suspect it has something to do with "variable_get('image_sizes', NULL)". The zero values seem to come from there. Maybe it is related to this issue:

http://drupal.org/node/45559
Something about empty 'image_size' entries in the "variables" database table.

aaron’s picture

i believe that the patch in http://drupal.org/node/70876 fixes this issue. let me know if it doesn't, and i'll look more closely.

klcthebookworm’s picture

Tried the patch, tried deleting everything and starting with fresh version of this module and get this error whenever I click on modules in the administration module:

Parse error: parse error, unexpected T_VARIABLE, expecting ')' in /home/bikermic/public_html/modules/image_exact/image_exact.module on line 39

Was hoping that this module would help with the now "no thumbnails created" issue I'm having with image.module, but I guess it's not meant to be.