diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2013-01-30 17:17:06 -0800 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2013-01-30 17:17:06 -0800 |
| commit | d8d01e0aa0cac2b8576ae481527d875213cdc3a7 (patch) | |
| tree | 1d56ab326ae495eaefaf2ecd8d411a27552ff83f /modules/gallery/helpers/item.php | |
| parent | 0ab40de11d65476454d4bf1129916a6856001002 (diff) | |
| parent | cf077425953a6a492dea97eaf1517e7d08c9648f (diff) | |
Merge pull request #112 from shadlaws/fix_1968
#1968 - Improve album cover generation/removal/etc.
Diffstat (limited to 'modules/gallery/helpers/item.php')
| -rw-r--r-- | modules/gallery/helpers/item.php | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index 386eeb08..093feb2d 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -78,15 +78,9 @@ class item_Core { model_cache::clear(); $parent->album_cover_item_id = $item->is_album() ? $item->album_cover_item_id : $item->id; - if ($item->thumb_dirty) { - $parent->thumb_dirty = 1; - graphics::generate($parent); - } else { - copy($item->thumb_path(), $parent->thumb_path()); - $parent->thumb_width = $item->thumb_width; - $parent->thumb_height = $item->thumb_height; - } $parent->save(); + graphics::generate($parent); + $grand_parent = $parent->parent(); if ($grand_parent && access::can("edit", $grand_parent) && $grand_parent->album_cover_item_id == null) { @@ -97,15 +91,10 @@ class item_Core { static function remove_album_cover($album) { access::required("view", $album); access::required("edit", $album); - @unlink($album->thumb_path()); model_cache::clear(); $album->album_cover_item_id = null; - $album->thumb_width = 0; - $album->thumb_height = 0; - $album->thumb_dirty = 1; $album->save(); - graphics::generate($album); } /** |
