From e8d2eed1bab8e3a63cbfd2f95237bbb242c2d119 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 14 Dec 2018 11:05:07 -0500 Subject: [PATCH] Add @horst-n fix for processwire/processwire-issues#715 --- wire/core/ImageSizerEngine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wire/core/ImageSizerEngine.php b/wire/core/ImageSizerEngine.php index 2546177d..6268044f 100755 --- a/wire/core/ImageSizerEngine.php +++ b/wire/core/ImageSizerEngine.php @@ -675,7 +675,7 @@ abstract class ImageSizerEngine extends WireData implements Module, Configurable // we scale down the target dimensions to fit within the image dimensions, // with respect to the target dimensions ratio $ratioSource = $img['height'] / $img['width']; - $ratioTarget = $targetHeight / $targetWidth; + $ratioTarget = !$this->cropping ? $ratioSource : $targetHeight / $targetWidth; if($ratioSource >= $ratioTarget) { // ratio is equal or target fits into source $pWidth = $targetWidth = $img['width'];