From 05bf8b444599893414449bd519c0b458939a6ee7 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 17 May 2022 10:19:54 +0200 Subject: Fix cropped image generated when not asked The $crop parameter was not propagated to the imaginary pipeline and instead it used the smartcrop algorithm always Signed-off-by: Carl Schwan --- lib/private/Preview/Generator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index e058a15bfa5..a19a19ef15f 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -144,6 +144,7 @@ class Generator { && ($specifications[0]['width'] <= 256 || $specifications[0]['height'] <= 256) && preg_match(Imaginary::supportedMimeTypes(), $mimeType) && $this->config->getSystemValueString('preview_imaginary_url', 'invalid') !== 'invalid') { + $crop = $specifications[0]['crop'] ?? false; $preview = $this->getSmallImagePreview($previewFolder, $file, $mimeType, $previewVersion, $crop); @@ -255,7 +256,7 @@ class Generator { continue; } - $preview = $this->helper->getThumbnail($provider, $file, 256, 256, true); + $preview = $this->helper->getThumbnail($provider, $file, 256, 256, $crop); if (!($preview instanceof IImage)) { continue; -- cgit v1.2.3