sorting by exif date sorting by exif date
 

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]

Main Menu

sorting by exif date

Started by diedhert, February 27, 2013, 02:59:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

diedhert

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

Αndré

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.

diedhert

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

Ludger

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

phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

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.

Ludger

Quote from: Αndré 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.
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...

Αndré

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.

Ludger

Quote from: Αndré 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.
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.

Αndré

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.