1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 10:45:54 +02:00
This commit is contained in:
Ryan Cramer
2018-12-14 11:05:07 -05:00
parent 05fd707b9c
commit e8d2eed1ba

View File

@@ -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'];