From 6df44e407afbfdbf5ab4ad13602ee8aedf22d125 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?=
 <skjnldsv@protonmail.com>
Date: Sun, 22 Dec 2019 15:07:11 +0100
Subject: [PATCH] Also center vertically when cropping previews
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
---
 lib/private/Preview/Generator.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php
index 74fabc55a9a..dcd4ccd130c 100644
--- a/lib/private/Preview/Generator.php
+++ b/lib/private/Preview/Generator.php
@@ -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));
-- 
GitLab