From f98964467c57fe500901c0a3ccf4009447fc86ff Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 19 Apr 2021 01:32:08 +0900 Subject: [PATCH] Always use 'fill' thumbnail type by default --- modules/admin/admin.admin.view.php | 4 ++-- modules/file/file.controller.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index 125b818e9..3ef95a30c 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -577,12 +577,12 @@ class adminAdminView extends admin $oDocumentModel = getModel('document'); $config = $oDocumentModel->getDocumentConfig(); Context::set('thumbnail_target', $config->thumbnail_target ?: 'all'); - Context::set('thumbnail_type', $config->thumbnail_type ?: 'crop'); + Context::set('thumbnail_type', $config->thumbnail_type ?: 'fill'); Context::set('thumbnail_quality', $config->thumbnail_quality ?: 75); if ($config->thumbnail_type === 'none') { Context::set('thumbnail_target', 'none'); - Context::set('thumbnail_type', 'crop'); + Context::set('thumbnail_type', 'fill'); } // Default and enabled languages diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 602ab2db1..0be79a23d 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -1148,7 +1148,7 @@ class fileController extends file if ($result) { $thumbnail_name = $file_info['tmp_name'] . '.thumbnail.jpg'; - if (FileHandler::createImageFile($file_info['tmp_name'], $thumbnail_name, $adjusted['width'], $adjusted['height'], 'jpg', 'crop', $adjusted['quality'])) + if (FileHandler::createImageFile($file_info['tmp_name'], $thumbnail_name, $adjusted['width'], $adjusted['height'], 'jpg', 'fill', $adjusted['quality'])) { $file_info['thumbnail'] = $thumbnail_name; } @@ -1156,7 +1156,7 @@ class fileController extends file } else { - $result = FileHandler::createImageFile($file_info['tmp_name'], $output_name, $adjusted['width'], $adjusted['height'], $adjusted['type'], 'crop', $adjusted['quality'], $adjusted['rotate']); + $result = FileHandler::createImageFile($file_info['tmp_name'], $output_name, $adjusted['width'], $adjusted['height'], $adjusted['type'], 'fill', $adjusted['quality'], $adjusted['rotate']); } // Change to information in the output file