diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-31 17:38:20 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-01-31 17:38:20 +0000 |
commit | 7ef2dae07029ee7e9657ef3bf5122097e02a8886 (patch) | |
tree | 494aa11233e0ad1cbe50db6bf34b4eeb5cd129a0 | |
parent | 3d8164353f0150c6c0edbdcccba12dd3f6699d10 (diff) |
There doesn't seem to be a photo_created event anymore so change it to
item_created and check for a type of photo before trying to extract tags.
-rw-r--r-- | modules/tag/helpers/tag_event.php | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/modules/tag/helpers/tag_event.php b/modules/tag/helpers/tag_event.php index 8291cbb7..1025c9d2 100644 --- a/modules/tag/helpers/tag_event.php +++ b/modules/tag/helpers/tag_event.php @@ -24,15 +24,17 @@ class tag_event_Core { * * @param Item_Model $photo */ - static function photo_created($photo) { - $path = $photo->file_path(); - $tags = array(); - $size = getimagesize($photo->file_path(), $info); - if (is_array($info) && !empty($info["APP13"])) { - $iptc = iptcparse($info["APP13"]); - if (!empty($iptc["2#025"])) { - foreach($iptc["2#025"] as $tag) { - $tags[$tag]= 1; + static function item_created($photo) { + if ($photo->is_photo()) { + $path = $photo->file_path(); + $tags = array(); + $size = getimagesize($photo->file_path(), $info); + if (is_array($info) && !empty($info["APP13"])) { + $iptc = iptcparse($info["APP13"]); + if (!empty($iptc["2#025"])) { + foreach($iptc["2#025"] as $tag) { + $tags[$tag]= 1; + } } } } |