Displaying Date on which picture was taken instead of when picture was uploaded Displaying Date on which picture was taken instead of when picture was uploaded
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Displaying Date on which picture was taken instead of when picture was uploaded

Started by vrviji, January 10, 2005, 08:49:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vrviji

Hi,

This may be a feature request, but somehow I am quite sure that there is some way to display the date on which the picture was taken , instead of the date on which the picture was uploaded under each thumbnail. The date on which the picture was uploaded is pretty irrelevant to me, and I would prefer to display the Picture Taken date.

Question : How can I do this for all the thumbnails that are displayed under the Album listing ?

Is there a field which is customizable for me to put the date I want displayed under the thumbnail ? That way, even if the Coppermine Gallery cannot read the date on which the picture was taken from the JPEG image, I have a way of putting the date which I want displayed under the thumbnail.

My Gallery is at  www.sundram.org/cprmine


Thanks for any advise you may have for me.

Viji Rajasundram
www.sundram.org


Tranz


vrviji

I did that and got a one other thread that spoke of "changing' the date of the Upload to another date and requiring that we manually change the date on each picture in the ctime field.

Now -
While I have about 300 pictures in my gallery - so this is going to be an arduous task, I see if that is the only way, then I will go ahead and do that ( i.e. change the ctime value to the date I want ). Besides the fact that, we will lose one bit of information, which may or may not be relevant for some reasons. Anyway, between Upload date and Picture Taken date, I will prefer to have Picture Taken date.

However, where do I find the field "ctime" to change it. Is there a ctime field in the picture details page, where I can change this directly - or do I have go into PHP editing or edit directly the SQL database. If so, than, I can't do that as I have no idea as to how to do that, and will therefore just live with the way it is now. Hopefully, there is an Admin Tool or something that will allow me to edit the field directly.

I looked at the Edit Files option, but it only allows me to edit the text part - i.e. captions and titles. How nice if it offered to edit another field like ctime or another custom filed that can then be displayed instead of Upload Date.

Do you see my problem. I feel I am so close to getting it done. If only I knew where I could get my hands on that ctime field and change the date as I am uploading the files - all this would be resolved.

Any advice ?

Or is this a valid "New Feature" request ?  ( On the New Feature page - they did say make sure the feature is not available already - so, I am doing my due diligence, before posting this there.

Thanks all for the help.

Viji Rajasundram
www.sundram.org

Tranz

How about the threads that cover EXIF? Do your photos contain exif data?

vrviji

Yes, I seemed to find one response that sounds close to what I need :


************* Start of Paste **************
Figured out a way to display EXIF dates below thumbs.
" Reply #2 on: December 01, 2004, 12:52:21 PM "  

--------------------------------------------------------------------------------
I came up with a solution that works for me, and so I'll present it as an option for the many seeking to display the EXIF date below the thumbnail.

I have the "Sort by EXIF" mod applied, and it works great.  I noticed that when you run the mod, it extracts the EXIF date to the variable $pdate, and proceeds to write it to the database for each photo's "ptime".  I noticed that it also converts this date to a human-readable format to display as text on the "results" page that you see after running the function.  That variable is called $newdate.

Well, showing the date below the thumbnails was more important to me than showing a title (I don't use the title field at present anyway).  So I just altered the script to write the date to the 'title' field.

In util.php:

After:

Code:
$query = "UPDATE $picturetbl SET ptime='$pdate' WHERE pid='$pid' ";
       MYSQL_QUERY($query);I added:

Code:
$query = "UPDATE $picturetbl SET title='$newdate' WHERE pid='$pid' ";
     MYSQL_QUERY($query);  

A few lines above that, it defines the date format for $newdate.  I altered this a little bit to be what I wanted:


Code:
$newdate = date('D, M jS Y \&\n\b\s\p\; g:i a', $pdate);
I have attached a screenshot crop of how it looks now.  Works great if you value the date display over photos having a user-defined title.  Hopefully someday a feature will be implemented into CPG so that a date display and title display could co-exist, but for now this is how I'm getting by.  

*************** End of Paste *************

However, I do not want to lose the titles, which I have so painstakingly typed in as i uploaded each picture. I would rather just replace the UPLOAD date in the database, and therefore just cause it to display the new date ( the date from the EXIF info of each picture ) under the thumbnail. So, what should I change in this code here as suggested by this gentleman in his post ? And do I just edit util.php on my server in the crpmine directory ? and after that how do I make it run ? There is no option in Admin Tools to run util.php ( Isearched the forum for that already. Guess everyone but me knows how to run util.php !

Sorry, but I do not have that much experience in PHP.


Viji Rajasundram
www.sundram.org



vrviji

Further to my last post - I found that I would need to apply the EXIF Date MOD to my setup. The instructions are pretty complicated. As such, would it be possible to just have a modified file ( already modified by someone else ) just copied into my directory to perform this ?  And if so, would someone who has already done this mod, be kind enough to email this modified file to be uploaded into my coppermine directory ? The files that are modified are ( I think util.php and CONFIG ( TABLE PICTURES ) or something like that.

I am not very good at this, sorry.

Cheers,

Viji Rajasundram