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: Empty IPTC fields are being displayed  (Read 7324 times)

0 Members and 1 Guest are viewing this topic.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Empty IPTC fields are being displayed
« on: November 29, 2007, 08:16:27 am »

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

Quote
small 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:   
Code: [Select]
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:

Code: [Select]
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
« Last Edit: November 29, 2007, 12:57:46 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Empty IPTC fields are being displayed
« Reply #1 on: November 29, 2007, 12:57:34 pm »

Applied suggested improvements to SVN (both of cpg1.4.x as well as cpg1.5.x). Marking thread as "fixed".
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 19 queries.