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.
This commit is contained in:
Tim Almdal
2009-01-31 17:38:20 +00:00
parent 3d8164353f
commit 7ef2dae070

View File

@@ -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;
}
}
}
}