mirror of
https://github.com/processwire/processwire.git
synced 2025-08-14 10:45:54 +02:00
Add @horst-n fix for processwire/processwire-issues#715
This commit is contained in:
@@ -675,7 +675,7 @@ abstract class ImageSizerEngine extends WireData implements Module, Configurable
|
|||||||
// we scale down the target dimensions to fit within the image dimensions,
|
// we scale down the target dimensions to fit within the image dimensions,
|
||||||
// with respect to the target dimensions ratio
|
// with respect to the target dimensions ratio
|
||||||
$ratioSource = $img['height'] / $img['width'];
|
$ratioSource = $img['height'] / $img['width'];
|
||||||
$ratioTarget = $targetHeight / $targetWidth;
|
$ratioTarget = !$this->cropping ? $ratioSource : $targetHeight / $targetWidth;
|
||||||
if($ratioSource >= $ratioTarget) {
|
if($ratioSource >= $ratioTarget) {
|
||||||
// ratio is equal or target fits into source
|
// ratio is equal or target fits into source
|
||||||
$pWidth = $targetWidth = $img['width'];
|
$pWidth = $targetWidth = $img['width'];
|
||||||
|
Reference in New Issue
Block a user