[ATTACHMENTS] Respect config for smart crop

This commit is contained in:
Diogo Peralta Cordeiro 2021-05-01 22:54:02 +01:00 committed by Hugo Sales
parent ab060332f0
commit adb6680a01
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -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)) {