diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-01-23 14:03:44 -0500 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-01-23 14:03:44 -0500 |
commit | eefc9d555374678665f79275d0c6b6a70b7d443e (patch) | |
tree | e47c3f0cb120232b6fab8e9f04d0a338bdf6bf65 /modules/gallery/libraries | |
parent | b1fd5c9c8538d7179c287404a2161b0c0eaf14c8 (diff) |
Use the thumb proportion from the first item in an album if the album has children. Fixes #1958.
Diffstat (limited to 'modules/gallery/libraries')
-rw-r--r-- | modules/gallery/libraries/Theme_View.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 1dfa72a0..8d69f23b 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -63,6 +63,13 @@ class Theme_View_Core extends Gallery_View { * @return int */ public function thumb_proportion($item=null) { + // If the item is an album with children, grab the first item in that album instead. We're + // interested in the size of the thumbnails in this album, not the thumbnail of the + // album itself. + if ($item && $item->is_album() && $item->children_count()) { + $item = $item->children(1)->current(); + } + // By default we have a globally fixed thumbnail size In core code, we just return a fixed // proportion based on the global thumbnail size, but since modules can override that, we // return the actual proportions when we have them. |