From 6715a36dad52d37b54c63c9ccc0f9532d61e1b43 Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 8 Oct 2010 15:32:12 -0300 Subject: CVS update --- exif.class.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'exif.class.php') diff --git a/exif.class.php b/exif.class.php index 29a0b02..8f310c8 100644 --- a/exif.class.php +++ b/exif.class.php @@ -66,23 +66,25 @@ Class Exif { return array(); } $exif = exif_read_data($file, 0); + $arSmallExif = array(); $arSmallExif = array_change_key_case((array)$exif, CASE_LOWER); $arSmallExif['computed'] = array_change_key_case((array)$arSmallExif['computed'], CASE_LOWER); //why this function isn't recursive is beyond me $arSmallExif['thumbnail'] = array_change_key_case((array)$arSmallExif['thumbnail'], CASE_LOWER); $arSmallExif['comment'] = array_change_key_case((array)$arSmallExif['comment'], CASE_LOWER); $info = array(); - + foreach ($arTagNames as $tagName) { if ($tagName['section'] != 'iptc') { if (!empty($arSmallExif[$tagName['tag']])) { - $info[$tagName['section'] .'_'. $tagName['tag']] = $arSmallExif[$tagName['tag']]; + $info[$tagName['section'] .'_'. $tagName['tag']] = utf8_encode($arSmallExif[$tagName['tag']]); } elseif (!empty($arSmallExif[$tagName['section']][$tagName['tag']])) { - $info[$tagName['section'] .'_'. $tagName['tag']] = $arSmallExif[$tagName['section']][$tagName['tag']]; + $info[$tagName['section'] .'_'. $tagName['tag']] = utf8_encode($arSmallExif[$tagName['section']][$tagName['tag']]); } } } + return $info; } @@ -112,6 +114,7 @@ Class Exif { $humanReadableKey = $this->getHumanReadableIPTCkey(); $size = GetImageSize ($file, $infoImage); $iptc = empty($infoImage["APP13"]) ? array() : iptcparse($infoImage["APP13"]); + $arSmallIPTC = array(); if (is_array($iptc)) { foreach ($iptc as $key => $value) { @@ -167,8 +170,8 @@ Class Exif { foreach ($arTagNames as $tagName) { if ($tagName['section'] == "xmp") { // Get XMP field. - $config = $map[$tagName['tag']]; - $field = $this->readXMPItem($xmp, $config); + $config = $map[$tagName['tag']]; + $field = $this->readXMPItem($xmp, $config); $info[$tagName['section'] .'_'. $tagName['tag']] = $field; } } -- cgit v1.2.3