diff options
-rw-r--r-- | modules/gallery/controllers/quick.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 08a33138..dc0c380a 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -46,13 +46,14 @@ class Quick_Controller extends Controller { graphics::generate($item); - $parent = $item->parent(); - // @todo: this is an inadequate way to regenerate the parent's thumbnail after rotation. - if ($parent->album_cover_item_id == $item->id) { - copy($item->thumb_path(), $parent->thumb_path()); - $parent->thumb_width = $item->thumb_width; - $parent->thumb_height = $item->thumb_height; - $parent->save(); + // @todo: this is an inadequate way to regenerate album cover thumbnails after rotation. + foreach (ORM::factory("item") + ->where("album_cover_item_id", "=", $item->id) + ->find_all() as $target) { + copy($item->thumb_path(), $target->thumb_path()); + $target->thumb_width = $item->thumb_width; + $target->thumb_height = $item->thumb_height; + $target->save(); } } |