summaryrefslogtreecommitdiffstats
path: root/lib/private/Preview
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-05-17 10:19:54 +0200
committerCarl Schwan <carl@carlschwan.eu>2022-05-17 10:19:54 +0200
commit05bf8b444599893414449bd519c0b458939a6ee7 (patch)
tree735b5f20066ec006837141ff53c02869062d7db4 /lib/private/Preview
parentab0548e4edb1d2cf47718f752272d68aa6be07e2 (diff)
downloadnextcloud-server-05bf8b444599893414449bd519c0b458939a6ee7.tar.gz
nextcloud-server-05bf8b444599893414449bd519c0b458939a6ee7.zip
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 <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/Preview')
-rw-r--r--lib/private/Preview/Generator.php3
1 files changed, 2 insertions, 1 deletions
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;