source: trunk/include/picture_metadata.inc.php @ 1682

Last change on this file since 1682 was 1682, checked in by rub, 17 years ago

Fix Feature Issue ID 0000585.

Convergence of exif configuration between local site and remote site.

Notes added on administration page where configuration is not OK.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
5// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | branch        : BSF (Best So Far)
8// | file          : $RCSfile$
9// | last update   : $Date: 2006-12-28 00:06:06 +0000 (Thu, 28 Dec 2006) $
10// | last modifier : $Author: rub $
11// | revision      : $Revision: 1682 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | General Public License for more details.                              |
21// |                                                                       |
22// | You should have received a copy of the GNU General Public License     |
23// | along with this program; if not, write to the Free Software           |
24// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28/**
29 * This file is included by the picture page to manage picture metadata
30 *
31 */
32
33include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php');
34$template->assign_block_vars('metadata', array());
35if (($conf['show_exif']) and (function_exists('read_exif_data')))
36{
37  if ($exif = @read_exif_data($picture['current']['image_path']))
38  {
39    $exif = trigger_event('format_exif_data', $exif, $picture['current'] );
40    $template->assign_block_vars(
41      'metadata.headline',
42      array('TITLE' => 'EXIF Metadata')
43      );
44
45    foreach ($conf['show_exif_fields'] as $field)
46    {
47      if (strpos($field, ';') === false)
48      {
49        if (isset($exif[$field]))
50        {
51          $key = $field;
52          if (isset($lang['exif_field_'.$field]))
53          {
54            $key = $lang['exif_field_'.$field];
55          }
56
57          $template->assign_block_vars(
58            'metadata.line',
59            array(
60              'KEY' => $key,
61              'VALUE' => $exif[$field]
62              )
63            );
64        }
65      }
66      else
67      {
68        $tokens = explode(';', $field);
69        if (isset($exif[$tokens[0]][$tokens[1]]))
70        {
71          $key = $tokens[1];
72          if (isset($lang['exif_field_'.$tokens[1]]))
73          {
74            $key = $lang['exif_field_'.$tokens[1]];
75          }
76
77          $template->assign_block_vars(
78            'metadata.line',
79            array(
80              'KEY' => $key,
81              'VALUE' => $exif[$tokens[0]][$tokens[1]]
82              )
83            );
84        }
85      }
86    }
87  }
88}
89if ($conf['show_iptc'])
90{
91  $iptc = get_iptc_data($picture['current']['image_path'],
92                        $conf['show_iptc_mapping']);
93
94  if (count($iptc) > 0)
95  {
96    $template->assign_block_vars(
97      'metadata.headline',
98      array('TITLE' => 'IPTC Metadata')
99      );
100  }
101
102  foreach ($iptc as $field => $value)
103  {
104    $key = $field;
105    if (isset($lang[$field]))
106    {
107      $key = $lang[$field];
108    }
109
110    $template->assign_block_vars(
111      'metadata.line',
112      array(
113        'KEY' => $key,
114        'VALUE' => $value
115        )
116      );
117  }
118}
119
120
121?>
Note: See TracBrowser for help on using the repository browser.