division by zero error in exif.php in 1.1.6

i guess this may be due to some faulty exif data in the image (exposure time?),

the line err'ing was 370, so on line 370, in version 1.1.6, so i just muted the error:

from
if (($bottom % $top) == 0) {

to
if (@($bottom % $top) == 0) {

is this sensible?

Comments

  • line 371 was err'ing as well, so i added a check for zero to the code:

    } else if ($tag == '829a') { // Exposure Time
    if ($top == 0){
    $data = 'Unknown';
    }
    else if (($bottom % $top) == 0) {...

    anyway, there's a lot of if / elseif's there for the tags, wouldn't a switch be neater?
Sign In or Register to comment.