reading IPTC informations reading IPTC informations
 

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

reading IPTC informations

Started by philippefx, September 21, 2010, 04:31:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

philippefx

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

Αndré

Quote from: philippefx on September 21, 2010, 04:31:38 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?

philippefx

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

Αndré

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
$caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
to
$caption = (isset($iptc['Copyright'])) ? $iptc['Copyright'] : $caption;

philippefx

Quote from: Αndré 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
$caption = (isset($iptc['Caption'])) ? $iptc['Caption'] : $caption;
to
$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

Αndré

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 :)

philippefx

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

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