Merge pull request #18536 from nextcloud/enhancement/preview-center-vertically

Also center vertically when cropping previews
This commit is contained in:
Roeland Jago Douma 2019-12-23 08:36:10 +01:00 committed by GitHub
commit 323fe46ba1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -385,7 +385,7 @@ class Generator {
$preview->preciseResize((int)round($scaleW), (int)round($scaleH));
}
$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);
} else {
$preview->resize(max($width, $height));