forum.coppermine-gallery.net

No Support => Feature requests => Topic started by: jmbox on October 24, 2003, 12:09:02 am

Title: Date sort order
Post by: jmbox on October 24, 2003, 12:09:02 am
I notice that currently, when using the date sort order for the thumbnails, it sorts by the PID column rather than the CTIME column.

PID is not really a date and only matches CTIME order if you don't change your CTIMEs :D

However, what I would like to see is cpg picking up the date/time from the jpg file and storing that in the database and then being able to use that to sort by. The date on my jpgs are the date when I took the picture.

Somebody else asked about changing the filenames whilst in the system. This could be done in the "Edit Pics" section. You would just need to modify the filename on the disk and then update the table for the new filename. This same section could also be used to change your picture date/time if you needed to.

I'm new to cpg, but if I get some time, I can look into doing these changes.
Title: Date sort order
Post by: DJMaze on October 24, 2003, 12:23:48 am
When you upload a picture the present date/time of the upload is stored with image, not when you took the picture.

Although saveing upload time is not very hard to add.
Code: [Select]
//Get actual Greenwich meantime
$servergmt = date("Z");
$gmtime = time()-$servergmt;

// Set time and day number for example
$time = date("H:i:s",$gmtime);
$day = date("w",$gmtime);
Title: Date sort order
Post by: jmbox on October 24, 2003, 01:16:19 am
Yes, I know. I don't care about when I ftp'd them or uploaded them.

Current date doesn't interest me (I have a backlog of photos to process :) )

I'd like to use the date I took the photo, which is stored as the current modification time of the jpg file.
Title: Date sort order
Post by: jmbox on October 24, 2003, 02:22:51 pm
Looking through the code, I discovered the wonders of Exif data. This would be a much more reliable source to extract the photo date and insert into the database.

I don't yet have PHP 4.2 installed so I can't use the Exif data.  :(

I used filemtime($image) to set the image time at upload by inserting it into a new column called itime.

Then changed the sort array to this: 'da' => 'itime ASC', 'dd' => 'itime DESC'
Title: Date sort order
Post by: Tarique Sani on October 24, 2003, 02:30:14 pm
Quote from: "jmbox"
Looking through the code, I discovered the wonders of Exif data.

FYI the next version will have EXIF and IPTC support without requiring any special PHP extensions....

This is already there in the devel branch of the CVS
Title: Date sort order
Post by: jmbox on October 24, 2003, 02:40:23 pm
Quote from: "tarique"
FYI the next version will have EXIF and IPTC support without requiring any special PHP extensions....

This is already there in the devel branch of the CVS

Thanks. Look forward to it.