From 8ffed400035ccb8c6bbd9f3a75e3d995a6824712 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 16 Feb 2016 17:15:10 +0100 Subject: bug #325, use original TIFF for EXIF/IPTC read --- admin/include/functions_metadata.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'admin') diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php index 1b5b5bb73..01b453816 100644 --- a/admin/include/functions_metadata.php +++ b/admin/include/functions_metadata.php @@ -173,8 +173,24 @@ function get_sync_metadata($infos) $infos['filesize'] = floor($fs/1024); + $is_tiff = false; + if (isset($infos['representative_ext'])) { + if ($image_size = @getimagesize($file)) + { + $type = $image_size[2]; + + if (IMAGETYPE_TIFF_MM == $type or IMAGETYPE_TIFF_II == $type) + { + // in case of TIFF files, we want to use the original file and not + // the representative for EXIF/IPTC, but we need the representative + // for width/height (to compute the multiple size dimensions) + $is_tiff = true; + } + + } + $file = original_to_representative($file, $infos['representative_ext']); } @@ -184,6 +200,12 @@ function get_sync_metadata($infos) $infos['height'] = $image_size[1]; } + if ($is_tiff) + { + // back to original file + $file = PHPWG_ROOT_PATH.$infos['path']; + } + if ($conf['use_exif']) { $exif = get_sync_exif_data($file); -- cgit v1.2.3