Skip to content

Commit

Permalink
Merge pull request #18536 from nextcloud/enhancement/preview-center-v…
Browse files Browse the repository at this point in the history
…ertically

Also center vertically when cropping previews
  • Loading branch information
rullzer committed Dec 23, 2019
2 parents 1d8da46 + 6df44e4 commit 323fe46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Preview/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ private function generatePreview(ISimpleFolder $previewFolder, ISimpleFile $maxP
$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));
Expand Down

0 comments on commit 323fe46

Please sign in to comment.