forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: pressurecooker on April 16, 2009, 11:37:37 am

Title: Can I Sort Thumbnails by Certain EXIF Tags?
Post by: pressurecooker on April 16, 2009, 11:37:37 am
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.
Title: Re: Can I Sort Thumbnails by Certain EXIF Tags?
Post by: Stramm on April 16, 2009, 03:35:58 pm
Not out of the box. That'll need some additional coding.
As far as I'm concerned to much for free support.
Title: Re: Can I Sort Thumbnails by Certain EXIF Tags?
Post by: pressurecooker on April 27, 2009, 05:58:45 pm
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?
Title: Re: Can I Sort Thumbnails by Certain EXIF Tags?
Post by: pressurecooker on April 28, 2009, 03:17:25 pm
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
Code: [Select]
$select_columns = 'pid, filepath, filename, url_prefix, filesize, pwidth, pheight, ctime, aid, keywords';
and change it to:
Code: [Select]
$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
Title: Re: Can I Sort Thumbnails by Certain EXIF Tags?
Post by: Stramm on April 28, 2009, 03:55:30 pm
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?