Add option to maintain file format when resizing #1508

This commit is contained in:
Kijin Sung 2020-12-21 10:22:53 +09:00
parent 198bb1b079
commit 32aae27a13
6 changed files with 32 additions and 6 deletions

View file

@ -1098,7 +1098,7 @@ class fileController extends file
$adjusted['width'] = (int)$resize_width;
$adjusted['height'] = (int)$resize_height;
if (!$is_animated && $adjusted['type'] === $image_info['type'])
if (!$is_animated && $adjusted['type'] === $image_info['type'] && $config->max_image_size_same_format !== 'Y')
{
$adjusted['type'] = 'jpg';
}