diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-05-17 10:19:54 +0200 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-05-17 10:19:54 +0200 |
commit | 05bf8b444599893414449bd519c0b458939a6ee7 (patch) | |
tree | 735b5f20066ec006837141ff53c02869062d7db4 /lib/private/Preview | |
parent | ab0548e4edb1d2cf47718f752272d68aa6be07e2 (diff) | |
download | nextcloud-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.php | 3 |
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; |