Empty IPTC fields are being displayed Empty IPTC fields are being displayed
 

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

Empty IPTC fields are being displayed

Started by Joachim Müller, November 29, 2007, 08:16:27 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Joachim Müller

Originally posted in http://www.pragmamx.org/Forum-topic-23114.html in German, here's the rough translation:

Quotesmall request.  :-X
I have IPTC display enabled. Only the field "Copyright" is being populated.
However, empty fields are being displayed. I have to workaround this by applying the changes suggested below to dsiplayimage.php each time I have to update:

Original code:
starting at line 191:   
if (isset($iptc) && is_array($iptc)) {
      array_walk($iptc, 'sanitize_data');
        if (isset($iptc['Title'])) $info[$lang_picinfo['iptcTitle']] = $iptc['Title'];
        if (isset($iptc['Copyright'])) $info[$lang_picinfo['iptcCopyright']] = $iptc['Copyright'];
        if (!empty($iptc['Keywords'])) $info[$lang_picinfo['iptcKeywords']] = implode(' ',$iptc['Keywords']);
        if (isset($iptc['Category'])) $info[$lang_picinfo['iptcCategory']] = $iptc['Category'];
        if (!empty($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = implode(' ',$iptc['SubCategories']);
    }
   
Better would be:

if (isset($iptc) && is_array($iptc)) {
      array_walk($iptc, 'sanitize_data');
        if (!empty($iptc['Title'])) $info[$lang_picinfo['iptcTitle']] = $iptc['Title'];
        if (!empty($iptc['Copyright'])) $info[$lang_picinfo['iptcCopyright']] = $iptc['Copyright'];
        if (!empty($iptc['Keywords'])) $info[$lang_picinfo['iptcKeywords']] = implode(' ',$iptc['Keywords']);
        if (!empty($iptc['Category'])) $info[$lang_picinfo['iptcCategory']] = $iptc['Category'];
        if (!empty($iptc['SubCategories'])) $info[$lang_picinfo['iptcSubCategories']] = implode(' ',$iptc['SubCategories']);
    }

Could you please add this to the next version?

(my gallery resides at http://www.hppphoto.de)

Cheers xidefix

Joachim Müller

Applied suggested improvements to SVN (both of cpg1.4.x as well as cpg1.5.x). Marking thread as "fixed".