Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 2.32 KB  |  hits: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff -rupN gallery3-old/modules/exif/helpers/exif.php gallery3-new/modules/exif/helpers/exif.php
  2. --- gallery3-old/modules/exif/helpers/exif.php  2011-05-25 06:04:04.000000000 +0200
  3. +++ gallery3-new/modules/exif/helpers/exif.php  2011-06-22 23:13:42.304652048 +0200
  4. @@ -54,17 +54,33 @@ class exif_Core {
  5.        $size = getimagesize($item->file_path(), $info);
  6.        if (is_array($info) && !empty($info["APP13"])) {
  7.          $iptc = iptcparse($info["APP13"]);
  8. -        foreach (array("Keywords" => "2#025", "Caption" => "2#120") as $keyword => $iptc_key) {
  9. +        $title_overridden = false;
  10. +        foreach (array("Keywords" => "2#025", "Caption" => "2#120", "Headline" => "2#105", "ObjectName" => "2#005") as $keyword => $iptc_key) {
  11.            if (!empty($iptc[$iptc_key])) {
  12.              $value = implode(" ", $iptc[$iptc_key]);
  13.              $value = encoding::convert_to_utf8($value);
  14.              $keys[$keyword] = Input::clean($value);
  15.  
  16. +            if ($keyword == "Headline") {
  17. +              $item->title = $value;
  18. +              $title_overridden = true;
  19. +            }
  20. +            if ($keyword == "ObjectName" && !title_overridden) {
  21. +              $item->title = $value;
  22. +              $title_overridden = true;
  23. +            }
  24.              if ($keyword == "Caption" && !$item->description) {
  25.                $item->description = $value;
  26.              }
  27. +            if ($keyword == "Comment" && !$item->description) {
  28. +              $item->description = $value;
  29. +            }
  30.            }
  31.          }
  32. +        if (!$title_overridden) {
  33. +          $item->title = $item->description;
  34. +          $item->description = null;
  35. +        }
  36.        }
  37.      }
  38.      $item->save();
  39. @@ -127,6 +143,8 @@ class exif_Core {
  40.          "SceneType"       => array("SubIFD", "SceneType",         t("Scene Type"),       ),
  41.          "Sharpness"       => array("SubIFD", "Sharpness",         t("Sharpness"),        ),
  42.          "SubjectDistance" => array("SubIFD", "SubjectDistance",   t("Subject Distance"), ),
  43. +        "Headline"        => array("IPTC",   "Headline",          t("Headline"),         ),
  44. +        "ObjectName"      => array("IPTC",   "ObjectName",        t("ObjectName"),       ),
  45.          "Caption"         => array("IPTC",   "Caption",           t("Caption"),          ),
  46.          "Keywords"        => array("IPTC",   "Keywords",          t("Keywords"),         )
  47.        );