Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Empty IPTC fields are being displayed  (Read 8117 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.025 seconds with 18 queries.