summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/libraries/Theme_View.php5
-rw-r--r--themes/wind/views/page.html.php2
2 files changed, 4 insertions, 3 deletions
diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php
index 0a4c96e1..16c57794 100644
--- a/modules/gallery/libraries/Theme_View.php
+++ b/modules/gallery/libraries/Theme_View.php
@@ -60,9 +60,10 @@ class Theme_View_Core extends Gallery_View {
/**
* Proportion of the current thumb_size's to default
* @param object Item_Model (optional) check the proportions for this item
+ * @param int (optional) minimum thumbnail width
* @return int
*/
- public function thumb_proportion($item=null) {
+ public function thumb_proportion($item=null, $minimum_size=0) {
// 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.
@@ -74,7 +75,7 @@ class Theme_View_Core extends Gallery_View {
// proportion based on the global thumbnail size, but since modules can override that, we
// return the actual proportions when we have them.
if ($item && $item->has_thumb()) {
- return max($item->thumb_width, $item->thumb_height) / 200;
+ return max($item->thumb_width, $item->thumb_height, $minimum_size) / 200;
} else {
// @TODO change the 200 to a theme supplied value when and if we come up with an
// API to allow the theme to set defaults.
diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php
index 1bb329df..1dbb31c0 100644
--- a/themes/wind/views/page.html.php
+++ b/themes/wind/views/page.html.php
@@ -24,7 +24,7 @@
<link rel="apple-touch-icon-precomposed"
href="<?= url::file(module::get_var("gallery", "apple_touch_icon_url")) ?>" />
<? if ($theme->page_type == "collection"): ?>
- <? if (($thumb_proportion = $theme->thumb_proportion($theme->item())) != 1): ?>
+ <? if (($thumb_proportion = $theme->thumb_proportion($theme->item(), 100)) != 1): ?>
<? $new_width = round($thumb_proportion * 213) ?>
<? $new_height = round($thumb_proportion * 240) ?>
<style type="text/css">