aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-05-07 10:23:26 +0000
committerplegall <plg@piwigo.org>2010-05-07 10:23:26 +0000
commit445182279c50f7404414bb36b8b405eeee58265e (patch)
tree53d6757f0f65a7f90ceee43145840297b218f0f0 /include
parentacc0b274128a6c87f48ec0d523065fe05856307c (diff)
bug 1649 fixed: search EXIF/IPTC in the high definition photo if there is no
EXIF/IPTC in the web sized photo. git-svn-id: http://piwigo.org/svn/trunk@6093 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r--include/picture_metadata.inc.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/picture_metadata.inc.php b/include/picture_metadata.inc.php
index 57defae28..96f63cd50 100644
--- a/include/picture_metadata.inc.php
+++ b/include/picture_metadata.inc.php
@@ -29,7 +29,19 @@
include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php');
if (($conf['show_exif']) and (function_exists('read_exif_data')))
{
- if ($exif = @read_exif_data($picture['current']['image_path']))
+ $exif_mapping = array();
+ foreach ($conf['show_exif_fields'] as $field)
+ {
+ $exif_mapping[$field] = $field;
+ }
+
+ $exif = get_exif_data($picture['current']['image_path'], $exif_mapping);
+ if (count($exif) == 0 and $picture['current']['has_high'])
+ {
+ $exif = get_exif_data($picture['current']['high_url'], $exif_mapping);
+ }
+
+ if (count($exif) > 0)
{
$exif = trigger_event('format_exif_data', $exif, $picture['current'] );
@@ -72,8 +84,11 @@ if (($conf['show_exif']) and (function_exists('read_exif_data')))
if ($conf['show_iptc'])
{
- $iptc = get_iptc_data($picture['current']['image_path'],
- $conf['show_iptc_mapping']);
+ $iptc = get_iptc_data($picture['current']['image_path'], $conf['show_iptc_mapping']);
+ if (count($iptc) == 0 and $picture['current']['has_high'])
+ {
+ $iptc = get_iptc_data($picture['current']['high_url'], $conf['show_iptc_mapping']);
+ }
if (count($iptc) > 0)
{