Hello pemphoto,
I have developed a band-aid solution for the same problem I had encountered after starting my site. Please keep in mind, I am not a programmer, just an user. After following some suggestions on this forum and looking into the issue I have done the next:
1. Copied file config_default.inc.php onto my computer using Filezilla.
2. I renamed it to config_default.inc.php_120929 where six digits in the end were current date. This was my backup original file in case something goes wrong.
3. I have replaced few lines of the code to turn on and expand the IPTC mapping. First of all, the IPTC mapping is included into a Piwigo code, but it is not full and strangely enough, it is turned off by default. Why? I don't know. To keep it simple, below is a copy of the entire METADATA part of the config file the way it looks now in my installation. I'd like to hear from the real Piwigo developers on this practice. It works for me, but I believe one may have to do this trick again after any serious upgrade initiated by Piwigo team, unless they decide to include my code into a new installation. So here, this is the code, that replaces entire METADATA portion of the config file in the Piwigo 2.4.5:
***START COPYING WITH THE NEXT LINE*****************
// +-----------------------------------------------------------------------+
// | metadata |
// +-----------------------------------------------------------------------+
// show_iptc: Show IPTC metadata on picture.php if asked by user
$conf['show_iptc'] = true;
// show_iptc_mapping : is used for showing IPTC metadata on picture.php
// page. For each key of the array, you need to have the same key in the
// $lang array. For example, if my first key is 'iptc_keywords' (associated
// to '2#025') then you need to have $lang['iptc_keywords'] set in
// language/$user['language']/common.lang.php. If you don't have the lang
// var set, the key will be simply displayed
//
// To know how to associated iptc_field with their meaning, use
// tools/metadata.php
$conf['show_iptc_mapping'] = array(
'iptc_headline' => '2#105',
'iptc_caption' => '2#120',
'iptc_city' => '2#090',
'iptc_sublocation' => '2#092',
'iptc_province_state' => '2#095',
'iptc_country' => '2#101',
'iptc_country_code' => '2#100',
'iptc_keywords' => '2#025',
'iptc_caption_writer' => '2#122',
'iptc_byline' => '2#080',
'iptc_byline_title' => '2#085',
'iptc_object_attribute'=> '2#004',
'iptc_newscode' => '2#012',
'iptc_date_created' => '2#055',
'iptc_writer_editor' => '2#122',
'iptc_instructions' => '2#040',
'iptc_job_id' => '2#103',
'iptc_object_name' => '2#005',
'iptc_copyright_notice'=> '2#116',
'iptc_credit' => '2#110',
'iptc_source' => '2#115',
'iptc_contact' => '2#118'
);
// use_iptc: Use IPTC data during database synchronization with files
// metadata
$conf['use_iptc'] = true;
// use_iptc_mapping : in which IPTC fields will Piwigo find image
// information ? This setting is used during metadata synchronisation. It
// associates a piwigo_images column name to a IPTC key
$conf['use_iptc_mapping'] = array(
'iptc_headline' => '2#105',
'iptc_caption' => '2#120',
'iptc_city' => '2#090',
'iptc_sublocation' => '2#092',
'iptc_province_state' => '2#095',
'iptc_country' => '2#101',
'iptc_country_code' => '2#100',
'iptc_keywords' => '2#025',
'iptc_caption_writer' => '2#122',
'iptc_byline' => '2#080',
'iptc_byline_title' => '2#085',
'iptc_object_attribute'=> '2#004',
'iptc_newscode' => '2#012',
'iptc_date_created' => '2#055',
'iptc_writer_editor' => '2#122',
'iptc_instructions' => '2#040',
'iptc_job_id' => '2#103',
'iptc_object_name' => '2#005',
'iptc_copyright_notice'=> '2#116',
'iptc_credit' => '2#110',
'iptc_source' => '2#115',
'iptc_contact' => '2#118'
);
// show_exif: Show EXIF metadata on picture.php (table or line presentation
// avalaible)
$conf['show_exif'] = true;
// show_exif_fields : in EXIF fields, you can choose to display fields in
// sub-arrays, for example ['COMPUTED']['ApertureFNumber']. for this, add
// 'COMPUTED;ApertureFNumber' in $conf['show_exif_fields']
//
// The key displayed in picture.php will be $lang['exif_field_Make'] for
// example and if it exists. For compound fields, only take into account the
// last part : for key 'COMPUTED;ApertureFNumber', you need
// $lang['exif_field_ApertureFNumber']
//
// for PHP version newer than 4.1.2 :
// $conf['show_exif_fields'] = array('CameraMake','CameraModel','DateTime');
//
$conf['show_exif_fields'] = array(
'Make',
'Model',
'DateTimeOriginal',
'COMPUTED;ApertureFNumber'
);
// use_exif: Use EXIF data during database synchronization with files
// metadata
$conf['use_exif'] = true;
// use_exif_mapping: same behaviour as use_iptc_mapping
$conf['use_exif_mapping'] = array(
'date_creation' => 'DateTimeOriginal'
);
***************THIS IS THE END MY FRIEND. DON'T COPY THIS LINE*********
What it does? It adds the IPTC METADATA tab next to the EXIF METADATA only if you have the IPTC data in your image, like so:
http://www.ottawastockimages.com/picture.php?/411/category/27
Otherwise the tab would not appear at all, which I believe is very smart, but I can't take credit for that.
Please let us all know how it works (or does not) for you. I wish wider Piwigo community took part in IPTC related discussion.