diff --git a/modules/file/file.admin.controller.php b/modules/file/file.admin.controller.php index 6235750e2..1e5ae2e6d 100644 --- a/modules/file/file.admin.controller.php +++ b/modules/file/file.admin.controller.php @@ -92,6 +92,7 @@ class FileAdminController extends File $config->image_quality_adjustment = max(50, min(100, intval(Context::get('image_quality_adjustment')))); $config->image_autorotate = Context::get('image_autorotate') === 'Y' ? true : false; $config->image_remove_exif_data = Context::get('image_remove_exif_data') === 'Y' ? true : false; + $config->image_always_reencode = Context::get('image_always_reencode') === 'Y' ? true : false; // Video settings $config->max_video_width = intval(Context::get('max_video_width')) ?: ''; diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index c9ae4e628..cf1842a9e 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -1290,6 +1290,12 @@ class FileController extends File } } + // Check if this image should be reencoded anyway + if (isset($config->image_always_reencode) && $config->image_always_reencode) + { + $force = true; + } + // Convert image if adjusted if ($adjusted['width'] !== $image_info['width'] || $adjusted['height'] !== $image_info['height'] || diff --git a/modules/file/lang/en.php b/modules/file/lang/en.php index ffbcd5f54..64190e13f 100644 --- a/modules/file/lang/en.php +++ b/modules/file/lang/en.php @@ -107,6 +107,8 @@ $lang->image_autorotate = 'Fix Image Rotation'; $lang->about_image_autorotate = 'correct images that are rotated by mobile devices.'; $lang->image_remove_exif_data = 'Remove EXIF'; $lang->about_image_remove_exif_data = 'remove EXIF data including camera, GPS information, and more in image file for privacy.
Even if this option is not used, EXIF ​​data may be removed when the image is converted by other settings.'; +$lang->image_always_reencode = 'Always Reencode'; +$lang->about_image_always_reencode = 'Reencode images to a constant quality even if they do not meet one of the conditions above. This may help save disk space and traffic.'; $lang->image_autoconv_gif2mp4 = 'Convert GIF to MP4'; $lang->about_image_autoconv_gif2mp4 = 'convert animated GIF images into MP4 videos to save storage and bandwidth.
This requires ffmpeg settings below. Videos may not play properly in older browsers.'; $lang->max_video_size = 'Limit Video Size'; diff --git a/modules/file/lang/ko.php b/modules/file/lang/ko.php index b9f5ac7ae..3014e884c 100644 --- a/modules/file/lang/ko.php +++ b/modules/file/lang/ko.php @@ -107,6 +107,8 @@ $lang->image_autorotate = '이미지 회전 수정'; $lang->about_image_autorotate = '모바일 기기 등에서 잘못 회전된 이미지를 바로잡습니다.'; $lang->image_remove_exif_data = 'EXIF 제거'; $lang->about_image_remove_exif_data = '프라이버시를 위해 이미지 파일에서 카메라, GPS 정보 등이 포함되어 있는 EXIF 데이터를 삭제합니다.
이 옵션을 사용하지 않아도 다른 설정에 의해 이미지가 변환될 경우에도 EXIF 데이터가 삭제될 수 있습니다.'; +$lang->image_always_reencode = '무조건 재인코딩'; +$lang->about_image_always_reencode = '위에서 설정한 조건에 해당되지 않더라도 무조건 일정한 화질로 재인코딩하여 용량과 트래픽을 절약합니다.'; $lang->image_autoconv_gif2mp4 = 'GIF → MP4 변환'; $lang->about_image_autoconv_gif2mp4 = '움직이는 GIF 이미지를 MP4 동영상으로 변환하여 용량 및 트래픽을 절약합니다.
아래에서 ffmpeg 설정을 해야 하며, 구형 브라우저에서는 동영상이 재생되지 않을 수도 있습니다.'; $lang->max_video_size = '동영상 크기 제한'; diff --git a/modules/file/tpl/upload_config.html b/modules/file/tpl/upload_config.html index d5ea25b61..d87571d0f 100644 --- a/modules/file/tpl/upload_config.html +++ b/modules/file/tpl/upload_config.html @@ -129,6 +129,20 @@

{$lang->msg_cannot_use_exif}

+
+ +
+ + +

{$lang->about_image_always_reencode}

+
+