From addb6b5ddc363c52524e2bc37f41e89995c45cfb Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 4 May 2010 23:45:20 +0000 Subject: feature 620: ability to synchronize metadata from high definition photo, if no metadata available in "web sized" photo. This commit is a report of r4683 from update_metadata function in admin/include/functions_metadata.php in the duplicated code get_element_metadata of admin/site_reader_local.php. See feature 620 for details about code duplication. git-svn-id: http://piwigo.org/svn/trunk@6076 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/site_reader_local.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'admin') diff --git a/admin/site_reader_local.php b/admin/site_reader_local.php index b5e21cd0e..3a4001d1f 100644 --- a/admin/site_reader_local.php +++ b/admin/site_reader_local.php @@ -205,12 +205,22 @@ function get_element_metadata($file, $has_high = false) if ($conf['use_exif']) { - $data = array_merge($data, get_sync_exif_data($file) ); + $exif = get_sync_exif_data($file); + if (count($exif) == 0 and isset($data['high_filesize'])) + { + $exif = get_sync_exif_data($high_file); + } + $data = array_merge($data, $exif); } if ($conf['use_iptc']) { - $data = array_merge($data, get_sync_iptc_data($file) ); + $iptc = get_sync_iptc_data($file); + if (count($iptc) == 0 and isset($data['high_filesize'])) + { + $iptc = get_sync_iptc_data($high_file); + } + $data = array_merge($data, $iptc); } return $data; -- cgit v1.2.3