- diff -rupN gallery3-old/modules/exif/helpers/exif.php gallery3-new/modules/exif/helpers/exif.php
- --- gallery3-old/modules/exif/helpers/exif.php 2011-05-25 06:04:04.000000000 +0200
- +++ gallery3-new/modules/exif/helpers/exif.php 2011-06-22 23:13:42.304652048 +0200
- @@ -54,17 +54,33 @@ class exif_Core {
- $size = getimagesize($item->file_path(), $info);
- if (is_array($info) && !empty($info["APP13"])) {
- $iptc = iptcparse($info["APP13"]);
- - foreach (array("Keywords" => "2#025", "Caption" => "2#120") as $keyword => $iptc_key) {
- + $title_overridden = false;
- + foreach (array("Keywords" => "2#025", "Caption" => "2#120", "Headline" => "2#105", "ObjectName" => "2#005") as $keyword => $iptc_key) {
- if (!empty($iptc[$iptc_key])) {
- $value = implode(" ", $iptc[$iptc_key]);
- $value = encoding::convert_to_utf8($value);
- $keys[$keyword] = Input::clean($value);
- + if ($keyword == "Headline") {
- + $item->title = $value;
- + $title_overridden = true;
- + }
- + if ($keyword == "ObjectName" && !title_overridden) {
- + $item->title = $value;
- + $title_overridden = true;
- + }
- if ($keyword == "Caption" && !$item->description) {
- $item->description = $value;
- }
- + if ($keyword == "Comment" && !$item->description) {
- + $item->description = $value;
- + }
- }
- }
- + if (!$title_overridden) {
- + $item->title = $item->description;
- + $item->description = null;
- + }
- }
- }
- $item->save();
- @@ -127,6 +143,8 @@ class exif_Core {
- "SceneType" => array("SubIFD", "SceneType", t("Scene Type"), ),
- "Sharpness" => array("SubIFD", "Sharpness", t("Sharpness"), ),
- "SubjectDistance" => array("SubIFD", "SubjectDistance", t("Subject Distance"), ),
- + "Headline" => array("IPTC", "Headline", t("Headline"), ),
- + "ObjectName" => array("IPTC", "ObjectName", t("ObjectName"), ),
- "Caption" => array("IPTC", "Caption", t("Caption"), ),
- "Keywords" => array("IPTC", "Keywords", t("Keywords"), )
- );