mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-12 02:03:50 -04:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user