diff options
Diffstat (limited to 'exif.class.php')
-rw-r--r-- | exif.class.php | 13 |
1 files changed, 8 insertions, 5 deletions
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; } } |