Following up on darkain at darkain dot com script for grabbing the ShutterSpeedValue from exif data...
@http://php.net/manual/en/function.exif-read-data.php
I have found that the option shown for ShutterSppedValue, can also be ExposureTime in the exif data.
Also the code as written provides a WRONG return, as the return is always 1 so you get 1/1sec.
Here is corrected code, or a version that corrects what is obviously not working after 5 years since it was originally developed::
Here is the updated version for:: $exif[ExposureTime]
function exif_get_float($value) {
$pos = strpos($value, '/');
if ($pos === false) return (float) $value;
$a = (float) substr($value, 0, $pos);
$b = (float) substr($value, $pos+1);
return ($b == 0) ? ($a) : ($a / $b);
};
function exif_get_exposureTime(&$exif) {
if (!isset($exif['ExposureTime'])) return false;
$apex = exif_get_float($exif['ExposureTime']);
$shutter = 1/$apex;
// above 1 sec exposure time::
if ($shutter <= 1) return round($apex) . ' seconds';
return '1/' . round(1 / $apex) . 'sec';
};