Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Date sort order  (Read 5019 times)

0 Members and 1 Guest are viewing this topic.

jmbox

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Date sort order
« 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.
Logged

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
Date sort order
« Reply #1 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);
Logged
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

jmbox

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Date sort order
« Reply #2 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.
Logged

jmbox

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Date sort order
« Reply #3 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'
Logged

Tarique Sani

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 2712
    • http://tariquesani.net
Date sort order
« Reply #4 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
Logged
SANIsoft PHP applications for E Biz

jmbox

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Date sort order
« Reply #5 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 21 queries.