Better focal length calculation #278

This commit is contained in:
Tobias Reich 2014-12-21 22:50:56 +01:00
parent c349b9fe09
commit 9d12f2ce54

View File

@ -659,7 +659,15 @@ class Photo extends Module {
if (isset($temp)) $return['shutter'] = $exif['ExposureTime'] . ' s';
$temp = @$exif['FocalLength'];
if (isset($temp)) $return['focal'] = $temp . ' mm';
if (isset($temp)) {
if (strpos($temp, '/')!==FALSE) {
$temp = explode('/', $temp, 2);
$temp = $temp[0] / $temp[1];
$temp = round($temp, 1);
$return['focal'] = $temp . ' mm';
}
$return['focal'] = $temp . ' mm';
}
$temp = @$exif['DateTimeOriginal'];
if (isset($temp)) $return['takestamp'] = strtotime($temp);