diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-01 21:56:02 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-07-01 21:56:02 -0700 |
commit | 588f991d558e86a07389e27c9ca9b1b4ab0f9fe7 (patch) | |
tree | 6b4e872abcc81683eacfbdb5f4c8018e1fe50f7d /modules/exif | |
parent | 60b201f23b70ab8a2fe8508e35adc6c2a11e792e (diff) |
Updated to Exifer r4159
Diffstat (limited to 'modules/exif')
-rw-r--r-- | modules/exif/lib/exif.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/exif/lib/exif.php b/modules/exif/lib/exif.php index 21b028f8..bd72f237 100644 --- a/modules/exif/lib/exif.php +++ b/modules/exif/lib/exif.php @@ -1007,8 +1007,16 @@ if ($result['ValidJpeg'] == 1) { //================================================================================================ function ConvertToFraction($v, &$n, &$d) { - $n = 1; - $d = !empty($v) ? round(1.0 / $v) : 0; + if ($v == 0) { + $n = 0; + $d = 1; + return; + } + for ($n=1; $n<100; $n++) { + $v1 = 1/$v*$n; + $d = round($v1, 0); + if (abs($d - $v1) < 0.02) return;// within tolarance + } } //================================================================================================ |