Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: Cyclist on December 09, 2005, 01:15:12 am

Title: [Fixed]: problem: EXIF date and time
Post by: Cyclist on December 09, 2005, 01:15:12 am
After modifying  as stated in now I am finally able to display Date and Time original but I discovered a little problem:
If I enable Date and Time Original in the EXIF manager the date fields "Date and Time" and "Date and Time Original original" are displayed. If I enable "Date and Time Digitized" both "Date and Time" and "Date and Time Digitized" are displayed BUT if I disable both "Date and Time Digitized" and "Date and Time Original " it also stops displaying the field ""Date and Time". Since all three EXIF fields contain exactly the same date and time I would prefer just displaying EXIF "Date and Time" but not "Date and Time Digitized" or "Date and Time Original". but I can't enable the field "Date and Time " in the EXIF manager. Is there any solution for this?
Title: Re: problem: EXIF date and time
Post by: ecto on December 10, 2005, 04:55:44 pm
You just found another bug.

The reason why DateTime is displayed is this line of code:

Code: [Select]
if (strpos($showExifStr,"|".$key) !== false && isset($val)){(original version is without without my "!==" hack, ofc)

Since that line only looks for the start of $key (i.e. "DateTime"), it will evaluate as true when it finds "DateTimeOriginal" or "DateTimedigitized" in $showExifStr, even though the key "DateTime" isn't even in $showExifStr.

Why DateTime isn't selectable in exifmgr.php I don't know (haven't looked into it), but it is a valid EXIF tag (at least in my camera), and hence should be selectable as an option in exifmgr.php, IMO. But as I said, I haven't looked into that matter so there may be a reason for it. Maybe a developer have a fast answer?

It seems it's as easy as this: if you want to be able to choose DateTime, just add it to $exif_info in exifmgr.php and in I.e., if you want to display DateTime between AFFocusPosition and Adapter you just change

Code: [Select]
$exif_info = "AFFocusPosition|Adapter|...";to
Code: [Select]
$exif_info = "AFFocusPosition|DateTime|Adapter|...";
Remember to do it in both files, and to go to exifmgr.php and review your checkboxes as they will be bumped out of order if you put DateTime anywhere else but last in $exif_info.

I have a working version of a new where I replace $showExifStr with an array instead, to be able to do a real comparison between what's in the $exif array and what should be shown. It works but has a few unsorted issues so far, I will post here when it's done.
Title: Re: problem: EXIF date and time
Post by: ecto on December 10, 2005, 08:29:22 pm
It's done now. See attached file. The files edited are and exifmgr.php. Please read my comments in as they say more than this post does.

What it does:
* Fixes the bug mentioned above so you don't have to see DateTime if you've chosen DateTimeOriginal or DateTimedigitized (or you can show only DateTime, like Cyclist wanted)
* Outputs lots of comments about the behaviour of, just comment out when you go live. But check them out first, might give you some ideas about how the whole thing works.. for example how many EXIF tags your pic has that CM doesn't recognize - two in my case, have no idea what they are for)
* Look in the comments for how to add your own EXIF (like I did with DateTime) and how to sort the EXIF info your own way.

Comments welcome.

Oh, and by the way - it's not thoroughly tested, so use at your own risk. :) Works like a charm for me though.
Title: Re: problem: EXIF date and time
Post by: mainpower on December 31, 2005, 11:35:59 pm
I just installed 1.4.3 and it still didn't work ... it's even worse for me.

Didn't get any DateTime with the new exif files included with 1.4.3 .. so I restored the 1.4.2 versions.
Maybe something to do with camera make ???

I would like to display DateTime only .. as the other two are the same ...  ;)

[EDIT: oeps .. wrong version numbers .. corrected them]
Title: Re: problem: EXIF date and time
Post by: Joachim Müller on January 01, 2006, 04:20:42 pm
don't hijack this thread with reference to the outdated versions cpg1.3.3 and cpg1.3.4
This thread deals with cpg1.4.x!
Title: Re: problem: EXIF date and time
Post by: spiros71 on May 10, 2006, 05:26:00 pm
I just added the changes suggested above and it did sort the problem. Now I use only Date Time.
The camera I use is Canon 20D.
Title: Re: problem: EXIF date and time
Post by: Joachim Müller on October 19, 2008, 12:52:40 pm
Haven't been looking into this in detail, but as far as I can see the issues that are being discussed in this thread no longer exist  because of the edits committed to exifmgr.php and the corresponding include file, so I'm marking this thread as "fixed".