Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: [Fixed]: problem: EXIF date and time  (Read 13183 times)

0 Members and 1 Guest are viewing this topic.

Cyclist

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 42
[Fixed]: problem: EXIF date and time
« on: December 09, 2005, 01:15:12 am »

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?
« Last Edit: October 19, 2008, 12:52:52 pm by Joachim Müller »
Logged

ecto

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 144
    • My very incomplete gallery
Re: problem: EXIF date and time
« Reply #1 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?

<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

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.
</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.
« Last Edit: December 10, 2005, 05:20:13 pm by ecto »
Logged

ecto

  • Supporter
  • Coppermine frequent poster
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 144
    • My very incomplete gallery
Re: problem: EXIF date and time
« Reply #2 on: December 10, 2005, 08:29:22 pm »

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

mainpower

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 30
    • Photo album of ... (with CPG)
Re: problem: EXIF date and time
« Reply #3 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]
« Last Edit: January 01, 2006, 04:24:29 pm by mainpower »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: problem: EXIF date and time
« Reply #4 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!
Logged

spiros71

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 68
    • Greek translation
Re: problem: EXIF date and time
« Reply #5 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.

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: problem: EXIF date and time
« Reply #6 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".
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.