mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-03 11:39:10 -04:00
Rotate all matching album covers when we rotate an item. Fixes ticket #1200.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user