Merge pull request #18536 from nextcloud/enhancement/preview-center-vertically
Also center vertically when cropping previews
This commit is contained in:
commit
323fe46ba1
|
@ -385,7 +385,7 @@ class Generator {
|
||||||
$preview->preciseResize((int)round($scaleW), (int)round($scaleH));
|
$preview->preciseResize((int)round($scaleW), (int)round($scaleH));
|
||||||
}
|
}
|
||||||
$cropX = (int)floor(abs($width - $preview->width()) * 0.5);
|
$cropX = (int)floor(abs($width - $preview->width()) * 0.5);
|
||||||
$cropY = 0;
|
$cropY = (int)floor(abs($height - $preview->height()) * 0.5);
|
||||||
$preview->crop($cropX, $cropY, $width, $height);
|
$preview->crop($cropX, $cropY, $width, $height);
|
||||||
} else {
|
} else {
|
||||||
$preview->resize(max($width, $height));
|
$preview->resize(max($width, $height));
|
||||||
|
|
Loading…
Reference in New Issue