mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-04-23 22:19:17 -04:00
Keep Item_Model::scale_dimensions from upscaling. Fixes #1579.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user