aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-02-16 17:15:10 +0100
committerplegall <plg@piwigo.org>2016-02-16 17:15:10 +0100
commit8ffed400035ccb8c6bbd9f3a75e3d995a6824712 (patch)
tree5afe2d45c0e2f9a46f8dc8286c7b33a43428a090 /admin
parent1fe2631774ad01f2f0e6301dc278f17122569998 (diff)
bug #325, use original TIFF for EXIF/IPTC read
Diffstat (limited to '')
-rw-r--r--admin/include/functions_metadata.php22
1 files changed, 22 insertions, 0 deletions
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);