From af4b0113baa18873d2f6c9796bbbc01f10b744d3 Mon Sep 17 00:00:00 2001 From: Diogo Peralta Cordeiro Date: Sat, 1 May 2021 22:54:02 +0100 Subject: [PATCH] [ATTACHMENTS] Respect config for smart crop --- src/Controller/Attachment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controller/Attachment.php b/src/Controller/Attachment.php index 88d17e612e..c47f666085 100644 --- a/src/Controller/Attachment.php +++ b/src/Controller/Attachment.php @@ -106,9 +106,10 @@ class Attachment extends Controller $default_width = Common::config('thumbnail', 'width'); $default_height = Common::config('thumbnail', 'height'); + $default_crop = Common::config('thumbnail', 'smart_crop'); $width = $this->int('w') ?: $default_width; $height = $this->int('h') ?: $default_height; - $crop = $this->bool('c') ?: false; + $crop = $this->bool('c') ?: $default_crop; Event::handle('GetAllowedThumbnailSizes', [&$sizes]); if (!in_array(['width' => $width, 'height' => $height], $sizes)) {