Can I Sort Thumbnails by Certain EXIF Tags? Can I Sort Thumbnails by Certain EXIF Tags?
 

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

Can I Sort Thumbnails by Certain EXIF Tags?

Started by pressurecooker, April 16, 2009, 11:37:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pressurecooker

Hi,

I'm trying to customize my Coppermine. At the moment I got loads of images with similar keywords. For example, I got 300 images with "Interior Design" as keyword. Unfortunately, my favourite images are displayed on page #14  :D
Regardless of how I set my sort options (Date, Title or Random), my faves are not prominent enough.

What I thought was this: there is a Rating tag (which is not currently supported by Coppermine, as I gather from exifmgr.php). I can assign rating to pictures using a program that I use to add keywords and copyright notices to EXIF.

Is there any way I can add the Rating tag so that Coppermine would recognize it and save onto the DB, then rewrite the bit that sorts the images so that they are prioritized by Rating and then by Date? How does this sound to you? Doable or I'm heading for a trouble?

Thanks.
Join the green campaign - Environmental Articles

Stramm

Not out of the box. That'll need some additional coding.
As far as I'm concerned to much for free support.

pressurecooker

Thank you for your reply. I will test my PHP knowledge and try to do it myself. Maybe you could give me some tips or directions?  ;)

One idea I had was to create a script outside Coppermine, where I can add rating from 1 to 10 to pictures (through drop-down boxes). Then I could sort the thumbnails.php by DATE and by my custom rating.

What do you think about this idea? Where should I edit the "sort by" options. Should I edit thumbnails.php or better do it through themes.php?
Join the green campaign - Environmental Articles

pressurecooker

An idea:

What if I take functions.inc.php (I now I must not ::) ) go to #895, where there is 'na' => 'filename ASC', and change this bit to 'na' => 'filename ASC, myrating ASC',

Then I go to
$select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords';

and change it to:
$select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords, myrating';

Then I create a new column in MySQL and use a simple php script to manually submit high ratings to pics I want to be displayed before others.

Now, theoretically, when I select "Sort By Filename" from Coppermine Admin, it should sort the pics by rating too.

What do you think guys?

Thank you
Join the green campaign - Environmental Articles

Stramm

You'll need to extend the sort_order array, the lang file entries for it and you need to modify the selector in the admin for it.

Then it may work. But just extending the select statement won't do any new sorting.

Why don't you use the 'sort my pictures' function instead?