[Fixed]: problem: EXIF date and time [Fixed]: problem: EXIF date and time
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Fixed]: problem: EXIF date and time

Started by Cyclist, December 09, 2005, 01:15:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Cyclist

After modifying  exif_php.inc.php  as stated in http://forum.coppermine-gallery.net/index.php?topic=24790.0 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?

ecto

#1
You just found another bug.

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

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?

<Edit>
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 exif_php.inc.php. I.e., if you want to display DateTime between AFFocusPosition and Adapter you just change

$exif_info = "AFFocusPosition|Adapter|...";
to
$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.
</Edit>

I have a working version of a new exif_php.inc.php 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.

ecto

It's done now. See attached file. The files edited are exif_php.inc.php and exifmgr.php. Please read my comments in exif_php.inc.php 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 exif_php.inc.php, 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.

mainpower

#3
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]

Joachim Müller

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!

spiros71

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.

http://www.translatum.gr/gallery/index.php

Joachim Müller

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".