Always use 'fill' thumbnail type by default

This commit is contained in:
Kijin Sung 2021-04-19 01:32:08 +09:00
parent e7f3f75839
commit f98964467c
2 changed files with 4 additions and 4 deletions

View file

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

View file

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