PDA

View Full Version : EE2.02 screwed up shutter speed interpretation (FIX HERE)


segal3
17th of December 2006 (Sun), 20:32
Whatever was done to 'fix' the non-broken shutter speed now incorrectly reads the shutter speed data.

Case in point - up until 2.02, my shutterspeeds have always been correct from EXIF and correctly displayed (as, for example '1/50s' or similar).

Today I uploaded 5 photos. Their real shutter speeds and EE2.02 shutter speeds are as follows:

Real 1/3s -> EE2.02 3s
Real 1/3s -> EE2.02 3s
Real 0.8s -> EE2.02 4s
Real 1s -> EE2.02 8s
Real 1/13s -> EE2.02 1/13s (correct)

Please provide a patch that makes the shutter speed interpretation work the old way! :(

(Edit - I uploaded five photos, not four - corrected).

Pekka
18th of December 2006 (Mon), 02:28
Please understand that sometimes fixes may break something else. Because I do not have all the possible files to test it happens I miss some new problems. I do not do it intentionally. It's not always possible to get back to older version just like that.

I would really like to have gather a set of files from various new cameras to build a test batch set for camera data reading. So if you see something fails please

- report what settings you EE has (EXIF: internal/php, is IPTC in use...)
- PM me info where to obtain a photo that is read wrong, to find a fix and test the fix.

That would be very helpful.

wkitty42
21st of December 2006 (Thu), 21:51
i have to wonder if choosing one format over another is really a way to go with this... possibly treating them the same and selecting the value from this one or that one if the value makes sense...

does that make sense?

ie: select all data to be EXIF unless IPTC contains info for "this" record/field... then select IPTC data for this record/field... drop back to EXIF preference...

Pekka
21st of December 2006 (Thu), 23:07
i have to wonder if choosing one format over another is really a way to go with this... possibly treating them the same and selecting the value from this one or that one if the value makes sense...

does that make sense?

ie: select all data to be EXIF unless IPTC contains info for "this" record/field... then select IPTC data for this record/field... drop back to EXIF preference...

Good comment. That is actually how it should be done (and is done in some places).

I have fixed the problem reported (unorthodox and results from exif reading between 1 and 1/4 sec) in PHOTODATA_datahandler.php with



// hack fix for (unknown origin) results like 8/10 (0.8), 3/10 (0.3)
if (strstr($shutter,"/")) {
if (!strstr($shutter,"1/")) {
$components = array();
$components = explode("/",$shutter);
$a_component = $components[0];
$b_component = $components[1];
$shutter = $a_component/$b_component;
}
}



// if shutter is read as a decimal, let's convert them to standard fractions:
# 1/16000 s 0.0000625
# 1/8000 s 0.000125
# 1/4000 s 0.00025
# 1/2000 s 0.0005
# 1/1000 s 0.001
# 1/640 s 0.0015
# 1/500 s 0.002
# 1/320 s 0.003
# 1/250 s 0.004
# 1/125 s 0.008
# 1/100 s 0.01
# 1/60 s 0.016
# 1/50 s 0.02
# 1/40 s 0.025
# 1/30 s 0.033
# 1/20 s 0.05
# 1/15 s 0.066
# 1/10 s 0.1
# 1/8 s 0.125
# 1/6 s 0.166
# 1/4 s 0.250
# 1/2 s 0.500

if ((float)$shutter < 0.000125 AND (float)$shutter >= 0.0000625) {
$shutter = "1/16000";
}
if ((float)$shutter < 0.00025 AND (float)$shutter >= 0.000125) {
$shutter = "1/8000";
}
if ((float)$shutter < 0.0005 AND (float)$shutter >= 0.00025) {
$shutter = "1/4000";
}
if ((float)$shutter < 0.001 AND (float)$shutter >= 0.0005) {
$shutter = "1/2000";
}
if ((float)$shutter < 0.0015 AND (float)$shutter >= 0.001) {
$shutter = "1/1000";
}
if ((float)$shutter < 0.002 AND (float)$shutter >= 0.0015) {
$shutter = "1/640";
}
if ((float)$shutter < 0.003 AND (float)$shutter >= 0.002) {
$shutter = "1/500";
}
if ((float)$shutter < 0.004 AND (float)$shutter >= 0.003) {
$shutter = "1/320";
}
if ((float)$shutter < 0.01 AND (float)$shutter >= 0.004) {
$shutter = "1/250";
}
if ((float)$shutter < 0.008 AND (float)$shutter >= 0.01) {
$shutter = "1/125";
}
if ((float)$shutter < 0.016 AND (float)$shutter >= 0.008) {
$shutter = "1/100";
}
if ((float)$shutter < 0.02 AND (float)$shutter >= 0.016) {
$shutter = "1/60";
}
if ((float)$shutter < 0.025 AND (float)$shutter >= 0.02) {
$shutter = "1/50";
}
if ((float)$shutter < 0.033 AND (float)$shutter >= 0.025) {
$shutter = "1/40";
}
if ((float)$shutter < 0.05 AND (float)$shutter >= 0.033) {
$shutter = "1/30";
}
if ((float)$shutter < 0.066 AND (float)$shutter >= 0.05) {
$shutter = "1/20";
}
if ((float)$shutter < 0.1 AND (float)$shutter >= 0.066) {
$shutter = "1/15";
}
if ((float)$shutter < 0.125 AND (float)$shutter >= 0.1) {
$shutter = "1/10";
}
if ((float)$shutter < 0.166 AND (float)$shutter >= 0.125) {
$shutter = "1/8";
}
if ((float)$shutter < 0.250 AND (float)$shutter >= 0.166) {
$shutter = "1/6";
}
if ((float)$shutter < 0.260 AND (float)$shutter >= 0.250) {
$shutter = "1/4";
}



(note that the last decimal->shutter if statement

if ((float)$shutter < 0.4 AND (float)$shutter >= 0.500) {
$shutter = "1/2";
}

mus be removed).

wkitty42
27th of December 2006 (Wed), 22:24
Good comment.
thanks! i actually have to try on some things ;)

That is actually how it should be done (and is done in some places).

I have fixed the problem reported (unorthodox and results from exif reading between 1 and 1/4 sec) in PHOTODATA_datahandler.php with

why only between 1 and 1/4 seconds? i'm just curious that way :)

kolohe
7th of January 2007 (Sun), 17:49
Pekka,

I have run into a problem with the internal EXIF parser. I have PM'd you with the file location.

It's coming up with a negative shutter speed value.

The PHP EXIF routines seem to work correctly with this photo, and the others where it's happening.

I hope this helps. It's certainly a complicated issue.

Paul

=============

An update after going through a bunch of photos with shutter speed errors.

I think I found a pattern. Anything slower than 1/2 second is getting multiplied by 10. For example, 1.3 seconds will show up as 13s. 0.6 seconds will show up as 6s. The lone exception to this seems to be 1.1 seconds which displays as 1/110.

One other cosmetic issue - 1 second displays as 1/1.

Hope this helps.