diff options
author | Bharat Mediratta <bharat@menalto.com> | 2011-01-05 21:05:20 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-07 20:18:24 -0800 |
commit | 85ae3202886d2bd132f6cd327cc2d9f0650ca911 (patch) | |
tree | 51d8eefa7b2fb3b66a9f5b8a1b34168d7620ec4b /modules | |
parent | 4756db435c1b934137f0ca2f169f74ab509ab72f (diff) |
Keep Item_Model::scale_dimensions from upscaling. Fixes #1579.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/models/item.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 7ddcb4c2..88a444b4 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -653,7 +653,7 @@ class Item_Model_Core extends ORM_MPTT { /** * Calculate the largest width/height that fits inside the given maximum, while preserving the - * aspect ratio. + * aspect ratio. Don't upscale. * @param int $max Maximum size of the largest dimension * @return array */ @@ -661,6 +661,10 @@ class Item_Model_Core extends ORM_MPTT { $width = $this->thumb_width; $height = $this->thumb_height; + if ($width <= $max && $height <= $max) { + return array($height, $width); + } + if ($height) { if (isset($max)) { if ($width > $height) { |