summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-01-31 17:38:20 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-01-31 17:38:20 +0000
commit7ef2dae07029ee7e9657ef3bf5122097e02a8886 (patch)
tree494aa11233e0ad1cbe50db6bf34b4eeb5cd129a0
parent3d8164353f0150c6c0edbdcccba12dd3f6699d10 (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.php20
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;
+ }
}
}
}