Browse files

Erronous interpretation of EXIF information

Fixed a bug that caused EXIF information in some (rare) cases to report
the aperture wrong.
  • Loading branch information...
1 parent f684051 commit bbc232ad3ffb8cd58f2c3955a792d300568e3930 @jeroenrnl committed Jan 27, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 php/exif.inc.php
View
6 php/exif.inc.php
@@ -111,7 +111,7 @@ function process_exif($image) {
$exifdata["focal_length"] = sprintf("%.1fmm", $a / $b);
}
}
-
+ $exifdata["exposure"]="";
if (isset($exif["ExposureTime"])) {
list($a, $b) = explode('/', $exif["ExposureTime"]);
if($b>0) {
@@ -147,13 +147,13 @@ function process_exif($image) {
else if (isset($exif["ApertureValue"])) {
list($a, $b) = explode('/', $exif["ApertureValue"]);
if($b>0) {
- $exifdata["aperture"] = sprintf("f/%.1f", $a / $b * log(2) * 0.5);
+ $exifdata["aperture"] = sprintf("f/%.1f", pow(2,($a / $b)/2));
}
}
else if (isset($exif["MaxApertureValue"])) {
list($a, $b) = explode('/', $exif["MaxApertureValue"]);
if($b>0) {
- $exifdata["aperture"] = sprintf("f/%.1f", $a / $b * log(2) * 0.5);
+ $exifdata["aperture"] = sprintf("f/%.1f", pow(2,($a / $b)/2));
}
}

0 comments on commit bbc232a

Please sign in to comment.