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: sorting by exif date  (Read 10950 times)

0 Members and 1 Guest are viewing this topic.

diedhert

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
sorting by exif date
« on: February 27, 2013, 02:59:39 pm »

Hello

Is it possible to sort pictures by the date they really were taken (in EXIF data) ? As I process my pictures in 'random' order with Lightroom, the Date Created or Changed is the date I wrote the picture after processing. Coppermine uses this date to sort, but I don't want that. I know in coppermine 1.4 sorting on EXIF was only possible after changing some things in one or another file, but I wonder if sorting on the real creation date (from exif) is already possible.

If not, is it possible to bulk change the Date Created from file to the same date as there is in the exif file ?

Thanks in advance
Diederik D'Hert
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: sorting by exif date
« Reply #1 on: February 28, 2013, 12:32:30 pm »

I haven't checked what exactly needs to be changed. Do you have a link to the cpg1.4.x mod?

You already asked how to change the file time stamp, which is probably the easiest way. To sync the file time stamp with the EXIF time stamp before upload, I personally use Windows tools like Exifer or FastStone Image Viewer.

As far as I remember there are already some thread which deals with sorting by EXIF data, unfortunately I currently cannot remember if any of it has been closed successfully.
Logged

diedhert

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 35
Re: sorting by exif date
« Reply #2 on: March 01, 2013, 08:05:12 pm »

Hello

Thanks for your answer. In Coppermine 1.4  I followed this thread to change everything so sorting by EXIF is working.
I really find it a pity that a program like Coppermine - which is used by million of people - has not a build in feature of sorting pictures by the exif date (date the pictures where taken). To me, this is the most logic sense of sorting, not ?
Coppermine is a really marvellous program ... but I don't understand this piece of sorting is missing.

Anyway, your suggestion of modifying the date might indeed be the easiest. I found three programs that do it in an easy way, which are Irfanview, Picture Go and Exif Date Changer. There are a lot of dos-based programs, but I find them very complicated.
For the ones that would be interested:
- Irfanview > go to thumbnails, Batch processing > Advanced options > and tick box with Save files with original time/date.
- Picture Go > Righ click on folder > choose 'Reset file date to Picture Date taken (Exif)'
- Exif Date Changer

Sincerely
Diederik D'Hert
Logged

Ludger

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
Re: sorting by exif date
« Reply #3 on: December 14, 2017, 10:30:00 pm »

Good evening,
I am new to this forum and have just recently moved my private picture and movie gallery to a Coppermine-based site. I like the software very much with one exception: I painfully missed the option of sorting the album thumbnails by the original date from EXIF data. And since I am used to making the things I miss myself, I started making a new plugin for exactly this purpose. Now this thing is basically done, I am still testing...
To do what it is supposed to do, my plugin depends on 2 CPGPluginAPI-Lines that I added to functions.inc.php. Would it be possible to add these two "plugs" to future releases of Coopermine 1.5 and 1.6? My plugin works with these two versions.
Best regards from Aachen, Germany
Ludger
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: sorting by exif date
« Reply #4 on: December 14, 2017, 11:32:57 pm »

If you start a new thread in the plugins section of 1.6 with your login attached plus the changes we can look at it for you. If the hooks are useful the we are more than happy to add them and your plugin for others to enjoy.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: sorting by exif date
« Reply #5 on: December 15, 2017, 08:26:28 am »

The first solution that comes to my mind for that question is to just update the "uploaded" timestamp with the Exif data, either during upload or as a cronjob. But as Phill said, we're also happy to add new useful plugin hooks.
Logged

Ludger

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
Re: Re: sorting by exif date
« Reply #6 on: December 15, 2017, 09:01:03 am »

The first solution that comes to my mind for that question is to just update the "uploaded" timestamp with the Exif data, either during upload or as a cronjob.
Off course, I tried this, but it did not work as exspected. The 4 sort options are the table columns filename, title, ctime and position. Ctime is the time of upload, not of the file...
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: sorting by exif date
« Reply #7 on: December 15, 2017, 09:10:01 am »

It would be an abuse of the ctime field, of course ;) I'll have a look at your plugin and your proposed plugin hooks. Any further discussion can be found there.
Logged

Ludger

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
Re: Sort by EXIF date
« Reply #8 on: December 15, 2017, 09:32:26 am »

It would be an abuse of the ctime field, of course ;) I'll have a look at your plugin and your proposed plugin hooks. Any further discussion can be found there.
I'm afraid this works exactly as designed:

In picmgmt.inc.php(183) the query is prepared for inserting the picture data:
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position, guest_token) VALUES ('{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}', '{$CURRENT_PIC_DATA['guest_token']}')";

...and in fuinctions.inc.php the column is offered as one of the sort-by-options:$sort_array = array(
            'na' => "filename $ASC, pid $ASC",
            'nd' => "filename $DESC, pid $DESC",
            'ta' => "title $ASC, pid $ASC",
            'td' => "title $DESC, pid $DESC",
            'da' => "ctime $ASC, pid $ASC",
            'dd' => "ctime $DESC, pid $DESC",
            'pa' => "position $ASC, pid $ASC",
            'pd' => "position $DESC, pid $DESC",
        );

So, if there is no misuse in between (like mine;-), we can only sort by the date of upload to coppermine.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: sorting by exif date
« Reply #9 on: December 15, 2017, 12:08:56 pm »

I splitted your reply from the other thread, as it's not related to your plugin but this discussion. Maybe I should have said "Any further discussion regarding the plugin and its hooks can be found there".

What I had in mind was to overwrite the content of ctime with the EXIF timestamps, after the files have been added to the database.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.