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: reading IPTC informations  (Read 3317 times)

0 Members and 1 Guest are viewing this topic.

philippefx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
reading IPTC informations
« on: September 21, 2010, 04:31:38 pm »

Hello,

Gallery http://photo.grangeneuve.ch/ (not mandatory : user's login "test", passwd "testforum")

If I enter some common IPTC data (with a software like IrfanView and its IPTC plugin, for example), it works. I can then go in "admin" mode, menu File, Albums, Edit, File Edit, and I can read my IPTC data like title, description, keywords, etc.

This data (title, description, keywords) are also directly used when importing new images.

Now I would like that Coppermine import, or used somewhere, one of this IPTC tag : Copyright, Credits or Source (hey, there is no "author" tag ? ...)

How can I do that ?


Thanks a lot,

Philippe
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: reading IPTC informations
« Reply #1 on: September 27, 2010, 04:43:55 pm »

This data (title, description, keywords) are also directly used when importing new images.
Here is the appropriate code:
Code: (include/picmgmt.inc.php) [Select]
        if ($CONFIG['read_iptc_data']) {
            // read IPTC data
            $iptc = get_IPTC($image);
            if (is_array($iptc) && !$title && !$caption && !$keywords) {  //if any of those 3 are filled out we don't want to override them, they may be blank on purpose.
                $title = (isset($iptc['Title'])) ? $iptc['Title'] : $title;
                $caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
                $keywords = (isset($iptc['Keywords'])) ? implode($CONFIG['keyword_separator'], $iptc['Keywords']) : $keywords;
            }
        }

Can you please attach a picture with IPTC data so I can perform some tests?
Logged

philippefx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: reading IPTC informations
« Reply #2 on: October 11, 2010, 05:24:51 pm »

Hello André,

Thanks for your reply. It seems it goes in the direction of coding changes and I don't want to do there (not enough time to test/maintain/etc.), I prefer to stay with config changes and no more.

I will mark the thread as "Solved", is it ok for you ?

In any case, I send you a photo with IPTC data in it. IPTC fileds like "Copyright", "Byline", Source", and some other are filled.


Thanks,
Philippe
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: reading IPTC informations
« Reply #3 on: October 12, 2010, 01:54:06 pm »

The code changes are very simple. The question is where do you want to store that additional data? Coppermine can store individual data as title, description and keywords. If you want to replace some IPTC fields with other ones, e.g. use the IPTC copyright as description, you'll just have to change
Code: [Select]
$caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;to
Code: [Select]
$caption = (isset($iptc['Copyright'])) ? $iptc['Copyright'] : $caption;
Logged

philippefx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: reading IPTC informations
« Reply #4 on: October 12, 2010, 02:04:23 pm »

The code changes are very simple. The question is where do you want to store that additional data? Coppermine can store individual data as title, description and keywords. If you want to replace some IPTC fields with other ones, e.g. use the IPTC copyright as description, you'll just have to change
Code: [Select]
$caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;to
Code: [Select]
$caption = (isset($iptc['Copyright'])) ? $iptc['Copyright'] : $caption;

And it works :) I tried it, but we need all this tags (title/descr/keyword). Thus it would be more complicated to add fields in the Coppermine's GUI (or inside the DB, etc.).
Using the "five optionnal fileds" is maybe a solution, but we choosed to add the author's name in the description fields and it's ok for us. "Simple is beautifull" :p
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: reading IPTC informations
« Reply #5 on: October 12, 2010, 02:09:01 pm »

You could also concatenate different IPTC data and add it to just one Coppermine field (e.g. add the caption, copyright and source to Coppermine's description field, maybe with a line break). That's just an idea and I'm sure you'll find the best solution for your gallery :)
Logged

philippefx

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 28
Re: reading IPTC informations
« Reply #6 on: October 12, 2010, 02:13:57 pm »

You could also concatenate different IPTC data and add it to just one Coppermine field (e.g. add the caption, copyright and source to Coppermine's description field, maybe with a line break). That's just an idea and I'm sure you'll find the best solution for your gallery :)

mhhh "just an idea" but it's a *very* good idea. The IPTC data stay clean and Coppermine get the right informations.
*Thanks* :))
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.