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: Can I Sort Thumbnails by Certain EXIF Tags?  (Read 2561 times)

0 Members and 1 Guest are viewing this topic.

pressurecooker

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 35
    • Environmental Articles
Can I Sort Thumbnails by Certain EXIF Tags?
« 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.
Logged
Join the green campaign - Environmental Articles

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Can I Sort Thumbnails by Certain EXIF Tags?
« Reply #1 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.

pressurecooker

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 35
    • Environmental Articles
Re: Can I Sort Thumbnails by Certain EXIF Tags?
« Reply #2 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?
Logged
Join the green campaign - Environmental Articles

pressurecooker

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 35
    • Environmental Articles
Re: Can I Sort Thumbnails by Certain EXIF Tags?
« Reply #3 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
Logged
Join the green campaign - Environmental Articles

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Can I Sort Thumbnails by Certain EXIF Tags?
« Reply #4 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?
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.