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
1 changed files with 1 additions and 1 deletions

View File

@ -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));