View Full Version : Wrong EXIF info stored in DB...
salobaas
01-21-2008, 08:32 AM
Hi,
when uploading photo's which are scanned and in which the only valid EXIF field is the camera model (set via an EXIF tool), I now always see when displaying with Simple:
Mamiya RZ65 Pro II (this is good)
0 sec
N/A
Flash: Fired
the last three being bogus. It turns out that in include/functions_exif.php you test for "" and not for "N/A" which causes 0 sec and Flash: Fired.
Can you please fix this.
Cheers, Fons.
salobaas
01-21-2008, 08:34 AM
To correct myself. The exif is ok in the DB, the handling on non-set fields in functions_exif.php is not correct.
-- Fons
Dkozikowski
01-21-2008, 08:38 AM
We understand. Dennis, our "EXIF guy", will check it out and make the necessary changes. Thank you for your input.
salobaas
01-21-2008, 09:13 AM
It would be nice to just have "" instead of "N/A" in the EXIF tags so Simple just nicely does not display anything.
Cheers, Fons.
Dennis
01-21-2008, 05:10 PM
Fons, can you provide me with an image with the exif? I can look into it then.
salobaas
01-21-2008, 05:28 PM
Hi Dennis,
like I said in a follow up, the EXIF info in the db is ok. The problem is in functions_exif.php. Here is the diff that works for me (with Simple and other themes that use the LANG_<exif> tags):
--- functions_exif.php.org 2008-01-21 10:54:10.000000000 +0100
+++ functions_exif.php 2008-01-21 11:03:40.000000000 +0100
@@ -77,7 +77,7 @@
} else {
$exposure = $empty_exif;
}
- if(isset($exposure)&&$exposure != "")
+ if(isset($exposure)&&$exposure != "N/A")
{
$exposure = reduceExif($exposure);
$exposure = "$exposure sec";
@@ -123,10 +123,10 @@
}
if(isset($flash)&&$flash == "No Flash") $flash = "$lang_flash_not_fired";
- elseif(isset($flash)&&$flash) $flash = "$lang_flash_fired";
- else $flash = "$lang_flash_not_detected";
+ elseif(isset($flash)&&$flash != "N/A") $flash = "$lang_flash_fired";
+ else $flash = "";
- if(isset($exposure)&&$exposure != "")
+ if(isset($exposure)&&$exposure != "N/A")
{
$exposure = "$exposure";
$tpl = ereg_replace("<EXIF_EXPOSURE_TIME>",$exposure,$tpl);
@@ -134,21 +134,21 @@
else
{
$exposure = "$empty_exif";
- $tpl = ereg_replace("<EXIF_EXPOSURE_TIME>",$exposure,$tpl);
+ $tpl = ereg_replace("<EXIF_EXPOSURE_TIME>","",$tpl);
}
$langexposure = "$lang_exposure $exposure";
$tpl = ereg_replace("<LANG_EXPOSURE_TIME>",$langexposure,$tpl);
- if(isset($aperture)&&$aperture != "")
+ if(isset($aperture)&&$aperture != "N/A")
{
$tpl = ereg_replace("<EXIF_APERTURE>",$aperture,$tpl);
}
else
{
$aperture = "$empty_exif";
- $tpl = ereg_replace("<EXIF_APERTURE>",$aperture,$tpl);
+ $tpl = ereg_replace("<EXIF_APERTURE>","",$tpl);
}
$langaperture = "$lang_aperture $aperture";
@@ -226,7 +226,7 @@
else
{
$flash = "$empty_exif";
- $tpl = ereg_replace("<EXIF_FLASH>",$flash,$tpl);
+ $tpl = ereg_replace("<EXIF_FLASH>","",$tpl);
}
}
return $tpl;
@@ -252,4 +252,4 @@
return $tpl;
}
-?>
\ No newline at end of file
+?>
Cheers, Fons.
Dennis
01-21-2008, 06:37 PM
Thanks for the diff Fons, I'm just curious because if I remember correctly if a field doesn't exists in the exif the field is empty.
Therefore I would like to see your photograph to determine if the exif perhaps contains "N/A" on those positions.
salobaas
01-21-2008, 09:59 PM
Hi Dennis,
the exif is empty (i.e. "") when it does not exist, but in functions_exif.php you set it, when empty, to "N/A" and later you test if the value is "".
For a photo with empty exif fields see:
http://fons.rademakers.org/photoblog/index.php?showimage=6
Cheers, Fons.
Dennis
01-22-2008, 05:56 PM
I checked the code today. If the exif field doesn't exists I replace the field with N/A.
So if the key exists I get the value, but this still can be an empty value. So therefore I test again if the value is empty.
However, for the exposure time the result is 0 (zero) so I should test for that. For the flash it is a bit more complicated, but testing for N/A is not going to work. I've fixed that too.
Thanks for mentioning, let me know if you're willing to test the file so I can send it to you.
salobaas
01-22-2008, 08:27 PM
Hi,
setting the values to "N/A" instead of "" looks ugly in the Simple theme, unless you switch to using the LANG versions, but that is again a bit too verbose for that theme.
Send me the file I can test it.
Cheers, Fons.
Dkozikowski
01-22-2008, 09:54 PM
We can't code pixelpost to what looks best in a theme.
You can hack your own files although we do not and will not support it.
salobaas
01-22-2008, 10:07 PM
No problem, have been doing that. But now the default Simple theme shows:
This is my photo title. +comments
Leica M6
0 sec
N/A
Flash: Has Fired
which looks not too cool. Note, the last three fields were not set in EXIF as the photo was scanned. In 1.5 it shows:
This is my photo title. +comments
Leica M6
As non-existing EXIF fields were left "".
Cheers, Fons.
Dkozikowski
01-22-2008, 10:30 PM
OK, so why can't you hack the files to make it behave like v1.5 ?
Do you not know where to look or are you looking for some other information?
salobaas
01-22-2008, 10:36 PM
I've hacked functions_exif.php so Simple theme looks like I had it in 1.5. I am happy. I just thought that you would like to have it look good out of the box, instead of leaving it as an "exercise to the user". -)
-- Fons
Dkozikowski
01-22-2008, 10:37 PM
I think it looks just fine. ;) It's all personal preference. :)
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.