Hello,
I have found a little error in the plugin "Exif View".
Line 121 is:
elseif ($tokens[1] > 0)
must be:
elseif ($tokens[1] > 1)
Otherwise the calculation of exposure time over 1s isn't correct.
Kind regards
Joe
Joe_76 wrote:
Hello,
I have found a little error in the plugin "Exif View".
Line 121 is:Code:
elseif ($tokens[1] > 0)must be:
Code:
elseif ($tokens[1] > 1)Otherwise the calculation of exposure time over 1s isn't correct.
Kind regards
Joe
Thanks this worked for me for my exposures that are longer than 1s, but not for my exposures that are longer than a minute... I'm not smart enough to figure out what will make it work... I changed line 121 to:
elseif ($tokens[1] > 10) and it didn't display my 2 and 3 minute exposures correctly, and if I change it to:
elseif ($tokens[1] > 100) then it displays a 120s exposure (for example) as 12000 s
Last edited by todd (2016-11-19 22:43:48)
Offline
Also, it still doesn't report right if the exposure time has a decimal... For example 4.86s reports as 1/0 s (as do any exosures longer than a minute after making the above fix for longer than 1s....)
Offline
todd wrote:
Joe_76 wrote:
Hello,
I have found a little error in the plugin "Exif View".
Line 121 is:Code:
elseif ($tokens[1] > 0)must be:
Code:
elseif ($tokens[1] > 1)Otherwise the calculation of exposure time over 1s isn't correct.
Kind regards
JoeThanks this worked for me for my exposures that are longer than 1s, but not for my exposures that are longer than a minute... I'm not smart enough to figure out what will make it work... I changed line 121 to:
elseif ($tokens[1] > 10) and it didn't display my 2 and 3 minute exposures correctly, and if I change it to:
elseif ($tokens[1] > 100) then it displays a 120s exposure (for example) as 12000 s
Well it seems I made one step in the right direction so far, just by messing around (aka quesswork).
for line 123 I changed: while ($tokens[0] % 10 == 0)
to: while ($tokens[0] % 100 == 0)
This makes it so my long exposures are reported correctly as long as they are whole seconds... For example a 180s exposure reports now as 180s.
It's still reporting "1/0 s" if there is a decimal (due to a lazy long bulb exposure, say 180.33s for example) so not sure if I'm going to get lucky on this, but will report back if I do.. ;)
Last edited by todd (2016-11-27 06:51:00)
Offline
Hello!
I rejected the whole elseif-structure and tried this calculation (starts at line 111):
// exposure time
if (!(strpos($key, 'ExposureTime') === FALSE)) {
$tokens = explode('/', $value);
if (isset($tokens[1]) && ($tokens[1] < $tokens[0]) )
{
return $tokens[0]/$tokens[1].' s';
}
else
{
return $value.' s';
}
}
It looks fine with the values produced by my Canon camera.
Kind regards
cars10
cars10 wrote:
Hello!
I rejected the whole elseif-structure and tried this calculation (starts at line 111):
// exposure time
if (!(strpos($key, 'ExposureTime') === FALSE)) {
$tokens = explode('/', $value);
if (isset($tokens[1]) && ($tokens[1] < $tokens[0]) )
{
return $tokens[0]/$tokens[1].' s';
}
else
{
return $value.' s';
}
}
It looks fine with the values produced by my Canon camera.
Kind regards
cars10
Thank you very much! This works better for me too.. Even reports odd untimed bulb time results with the decimals.
I did happen to notice with your code that some fractions don't report reduced. 1/2s will report as 5/10s etc... No biggy though! :)
Offline