mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
EXIF 제거 옵션 추가
This commit is contained in:
parent
1075b528d6
commit
a208526a5c
9 changed files with 87 additions and 39 deletions
|
|
@ -270,7 +270,6 @@ $lang->thumbnail_target = 'Extract Thumbnail From';
|
|||
$lang->thumbnail_target_all = 'All images';
|
||||
$lang->thumbnail_target_attachment = 'Attached images only';
|
||||
$lang->thumbnail_type = 'Thumbnail Type';
|
||||
$lang->thumbnail_quality = 'Quality';
|
||||
$lang->input_header_script = 'Header Script';
|
||||
$lang->detail_input_header_script = 'Content added here will be printed at the top of every page, except the admin module.';
|
||||
$lang->input_footer_script = 'Footer Script';
|
||||
|
|
|
|||
|
|
@ -273,7 +273,6 @@ $lang->detail_input_footer_script = '모든 페이지의 최하단에 코드를
|
|||
$lang->thumbnail_crop = '크기에 맞추어 잘라내기';
|
||||
$lang->thumbnail_ratio = '비율 유지 (여백이 생길 수 있음)';
|
||||
$lang->thumbnail_none = '썸네일 생성하지 않음';
|
||||
$lang->thumbnail_quality = '화질';
|
||||
$lang->admin_ip_allow = '관리자 로그인 허용 IP';
|
||||
$lang->admin_ip_deny = '관리자 로그인 금지 IP';
|
||||
$lang->local_ip_address = '로컬 IP 주소';
|
||||
|
|
|
|||
|
|
@ -136,9 +136,9 @@
|
|||
<input type="radio" name="thumbnail_type" id="thumbnail_type_ratio" value="ratio" checked="checked"|cond="$thumbnail_type == 'ratio'" />
|
||||
{$lang->thumbnail_ratio}
|
||||
</label>
|
||||
<select name="thumbnail_quality" id="thumbnail_quality" style="width:100px;min-width:100px">
|
||||
<select name="thumbnail_quality" id="thumbnail_quality" style="min-width:120px">
|
||||
<!--@for($q = 50; $q <= 100; $q += 5)-->
|
||||
<option value="{$q}" selected="selected"|cond="$thumbnail_quality == $q">{$lang->thumbnail_quality} {$q}%</option>
|
||||
<option value="{$q}" selected="selected"|cond="$thumbnail_quality === $q">{$lang->image_quality} {$q}%<!--@if($q === 75)--> ({$lang->standard})<!--@end--></option>
|
||||
<!--@endfor-->
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class fileAdminController extends file
|
|||
$config->max_image_size_admin = Context::get('max_image_size_admin') === 'Y' ? 'Y' : 'N';
|
||||
$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->video_thumbnail = Context::get('video_thumbnail') === 'Y' ? true : false;
|
||||
$config->video_mp4_gif_time = intval(Context::get('video_mp4_gif_time'));
|
||||
$config->ffmpeg_command = escape(utf8_trim(Context::get('ffmpeg_command'))) ?: '/usr/bin/ffmpeg';
|
||||
|
|
@ -153,81 +154,82 @@ class fileAdminController extends file
|
|||
*/
|
||||
function procFileAdminInsertModuleConfig()
|
||||
{
|
||||
$file_config = new stdClass;
|
||||
$config = new stdClass;
|
||||
|
||||
// Default
|
||||
if(!Context::get('use_default_file_config'))
|
||||
{
|
||||
$file_config->use_default_file_config = 'N';
|
||||
$file_config->allowed_filesize = Context::get('allowed_filesize');
|
||||
$file_config->allowed_attach_size = Context::get('allowed_attach_size');
|
||||
$file_config->allowed_filetypes = Context::get('allowed_filetypes');
|
||||
$config->use_default_file_config = 'N';
|
||||
$config->allowed_filesize = Context::get('allowed_filesize');
|
||||
$config->allowed_attach_size = Context::get('allowed_attach_size');
|
||||
$config->allowed_filetypes = Context::get('allowed_filetypes');
|
||||
|
||||
// Check maximum file size
|
||||
if (PHP_INT_SIZE < 8)
|
||||
{
|
||||
if ($file_config->allowed_filesize > 2047 || $file_config->allowed_attach_size > 2047)
|
||||
if ($config->allowed_filesize > 2047 || $config->allowed_attach_size > 2047)
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_32bit_max_2047mb');
|
||||
}
|
||||
}
|
||||
|
||||
// Simplify allowed_filetypes
|
||||
$file_config->allowed_extensions = strtr(strtolower(trim($file_config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||
if ($file_config->allowed_extensions)
|
||||
$config->allowed_extensions = strtr(strtolower(trim($config->allowed_filetypes)), array('*.' => '', ';' => ','));
|
||||
if ($config->allowed_extensions)
|
||||
{
|
||||
$file_config->allowed_extensions = array_map('trim', explode(',', $file_config->allowed_filetypes));
|
||||
$file_config->allowed_filetypes = implode(';', array_map(function($ext) {
|
||||
$config->allowed_extensions = array_map('trim', explode(',', $config->allowed_filetypes));
|
||||
$config->allowed_filetypes = implode(';', array_map(function($ext) {
|
||||
return '*.' . $ext;
|
||||
}, $file_config->allowed_extensions));
|
||||
}, $config->allowed_extensions));
|
||||
}
|
||||
else
|
||||
{
|
||||
$file_config->allowed_extensions = array();
|
||||
$file_config->allowed_filetypes = '*.*';
|
||||
$config->allowed_extensions = array();
|
||||
$config->allowed_filetypes = '*.*';
|
||||
}
|
||||
}
|
||||
|
||||
// Image
|
||||
if(!Context::get('use_image_default_file_config'))
|
||||
{
|
||||
$file_config->use_image_default_file_config = 'N';
|
||||
$file_config->image_autoconv['bmp2jpg'] = Context::get('image_autoconv_bmp2jpg') === 'Y' ? true : false;
|
||||
$file_config->image_autoconv['png2jpg'] = Context::get('image_autoconv_png2jpg') === 'Y' ? true : false;
|
||||
$file_config->image_autoconv['webp2jpg'] = Context::get('image_autoconv_webp2jpg') === 'Y' ? true : false;
|
||||
$file_config->image_autoconv['gif2mp4'] = Context::get('image_autoconv_gif2mp4') === 'Y' ? true : false;
|
||||
$file_config->max_image_width = intval(Context::get('max_image_width')) ?: '';
|
||||
$file_config->max_image_height = intval(Context::get('max_image_height')) ?: '';
|
||||
$file_config->max_image_size_action = Context::get('max_image_size_action') ?: '';
|
||||
$file_config->max_image_size_admin = Context::get('max_image_size_admin') === 'Y' ? 'Y' : 'N';
|
||||
$file_config->image_quality_adjustment = max(50, min(100, intval(Context::get('image_quality_adjustment'))));
|
||||
$file_config->image_autorotate = Context::get('image_autorotate') === 'Y' ? true : false;
|
||||
$config->use_image_default_file_config = 'N';
|
||||
$config->image_autoconv['bmp2jpg'] = Context::get('image_autoconv_bmp2jpg') === 'Y' ? true : false;
|
||||
$config->image_autoconv['png2jpg'] = Context::get('image_autoconv_png2jpg') === 'Y' ? true : false;
|
||||
$config->image_autoconv['webp2jpg'] = Context::get('image_autoconv_webp2jpg') === 'Y' ? true : false;
|
||||
$config->image_autoconv['gif2mp4'] = Context::get('image_autoconv_gif2mp4') === 'Y' ? true : false;
|
||||
$config->max_image_width = intval(Context::get('max_image_width')) ?: '';
|
||||
$config->max_image_height = intval(Context::get('max_image_height')) ?: '';
|
||||
$config->max_image_size_action = Context::get('max_image_size_action') ?: '';
|
||||
$config->max_image_size_admin = Context::get('max_image_size_admin') === 'Y' ? 'Y' : 'N';
|
||||
$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;
|
||||
}
|
||||
|
||||
// Video
|
||||
if(!Context::get('use_video_default_file_config'))
|
||||
{
|
||||
$file_config->use_video_default_file_config = 'N';
|
||||
$file_config->video_thumbnail = Context::get('video_thumbnail') === 'Y' ? true : false;
|
||||
$file_config->video_mp4_gif_time = intval(Context::get('video_mp4_gif_time'));
|
||||
$config->use_video_default_file_config = 'N';
|
||||
$config->video_thumbnail = Context::get('video_thumbnail') === 'Y' ? true : false;
|
||||
$config->video_mp4_gif_time = intval(Context::get('video_mp4_gif_time'));
|
||||
}
|
||||
|
||||
// Check download grant
|
||||
$download_grant = Context::get('download_grant');
|
||||
if(!is_array($download_grant))
|
||||
{
|
||||
$file_config->download_grant = explode('|@|',$download_grant);
|
||||
$config->download_grant = explode('|@|',$download_grant);
|
||||
}
|
||||
else
|
||||
{
|
||||
$file_config->download_grant = array_values($download_grant);
|
||||
$config->download_grant = array_values($download_grant);
|
||||
}
|
||||
|
||||
// Update
|
||||
$oModuleController = getController('module');
|
||||
foreach(explode(',', Context::get('target_module_srl')) as $module_srl)
|
||||
{
|
||||
$output = $oModuleController->insertModulePartConfig('file', trim($module_srl), $file_config);
|
||||
$output = $oModuleController->insertModulePartConfig('file', trim($module_srl), $config);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -1091,6 +1091,7 @@ class fileController extends file
|
|||
$file_info['height'] = $image_info['height'];
|
||||
|
||||
// Set base information
|
||||
$force = false;
|
||||
$adjusted = [
|
||||
'width' => $image_info['width'],
|
||||
'height' => $image_info['height'],
|
||||
|
|
@ -1141,7 +1142,6 @@ class fileController extends file
|
|||
$adjusted['rotate'] = $rotate;
|
||||
}
|
||||
}
|
||||
unset($exif);
|
||||
}
|
||||
|
||||
// Adjust image size
|
||||
|
|
@ -1191,8 +1191,22 @@ class fileController extends file
|
|||
}
|
||||
}
|
||||
|
||||
// Set force for remove EXIF data
|
||||
if($config->image_remove_exif_data && $image_info['type'] === 'jpg' && function_exists('exif_read_data'))
|
||||
{
|
||||
if(!isset($exif))
|
||||
{
|
||||
$exif = @exif_read_data($file_info['tmp_name']);
|
||||
}
|
||||
if($exif && (isset($exif['Model']) || isset($exif['Software']) || isset($exif['GPSVersion'])))
|
||||
{
|
||||
$force = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert image if adjusted
|
||||
if (
|
||||
$force ||
|
||||
$adjusted['width'] !== $image_info['width'] ||
|
||||
$adjusted['height'] !== $image_info['height'] ||
|
||||
$adjusted['type'] !== $image_info['type'] ||
|
||||
|
|
@ -1220,7 +1234,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'))
|
||||
if (FileHandler::createImageFile($file_info['tmp_name'], $thumbnail_name, $adjusted['width'], $adjusted['height'], 'jpg', 'crop', $adjusted['quality']))
|
||||
{
|
||||
$file_info['thumbnail'] = $thumbnail_name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,9 +87,11 @@ $lang->max_image_size_action_block = 'If exceeded, block upload';
|
|||
$lang->max_image_size_action_resize = 'If exceeded, resize automatically';
|
||||
$lang->max_image_size_admin = 'Also apply to administrator';
|
||||
$lang->image_quality_adjustment = 'Image Quality';
|
||||
$lang->about_image_quality_adjustment = 'adjust the quality of uploaded images.';
|
||||
$lang->about_image_quality_adjustment = 'adjust the quality of images that will is converted by other settings.<br />If set to more than 75% (Standard), the file size may be larger than the original.';
|
||||
$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.<br />Even if this option is not used, EXIF data may be removed when the image is converted by other settings.';
|
||||
$lang->image_autoconv_gif2mp4 = 'Convert GIF';
|
||||
$lang->about_image_autoconv_gif2mp4 = 'convert animated GIF images into MP4 videos to save storage and bandwidth.<br />Videos may not play properly in older browsers.';
|
||||
$lang->video_thumbnail = 'Video Thumbnail';
|
||||
|
|
|
|||
|
|
@ -88,9 +88,11 @@ $lang->max_image_size_action_block = '초과시 업로드 금지';
|
|||
$lang->max_image_size_action_resize = '초과시 자동 크기 조정';
|
||||
$lang->max_image_size_admin = '관리자에게도 적용';
|
||||
$lang->image_quality_adjustment = '이미지 화질';
|
||||
$lang->about_image_quality_adjustment = '업로드된 이미지의 화질을 조정합니다.';
|
||||
$lang->about_image_quality_adjustment = '다른 설정에 의해 이미지가 변환될 경우 화질을 조정합니다.<br />75% (표준) 이상으로 설정시 오히려 원본보다 용량이 늘어날 수 있습니다.';
|
||||
$lang->image_autorotate = '이미지 회전 수정';
|
||||
$lang->about_image_autorotate = '모바일 기기 등에서 잘못 회전된 이미지를 바로잡습니다.';
|
||||
$lang->image_remove_exif_data = 'EXIF 제거';
|
||||
$lang->about_image_remove_exif_data = '프라이버시를 위해 이미지 파일에서 카메라, GPS 정보 등이 포함되어 있는 EXIF 데이터를 삭제합니다.<br />이 옵션을 사용하지 않아도 다른 설정에 의해 이미지가 변환될 경우에도 EXIF 데이터가 삭제될 수 있습니다.';
|
||||
$lang->image_autoconv_gif2mp4 = 'GIF 변환';
|
||||
$lang->about_image_autoconv_gif2mp4 = '움직이는 GIF 이미지를 MP4 동영상으로 변환하여 용량 및 트래픽을 절약합니다.<br />구형 브라우저에서는 동영상이 재생되지 않을 수도 있습니다.';
|
||||
$lang->video_thumbnail = '동영상 섬네일';
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
<div class="x_controls">
|
||||
<select name="image_quality_adjustment" style="min-width:80px">
|
||||
<!--@for($q = 50; $q <= 100; $q += 5)-->
|
||||
<option value="{$q}" selected="selected"|cond="$config->image_quality_adjustment === $q"><!--@if($q === 100)-->{$lang->original_image_quality}<!--@else-->{$q}%<!--@end--></option>
|
||||
<option value="{$q}" selected="selected"|cond="$config->image_quality_adjustment === $q">{$q}%<!--@if($q === 75)--> ({$lang->standard})<!--@end--></option>
|
||||
<!--@endfor-->
|
||||
</select>
|
||||
<p class="x_help-block">{$lang->about_image_quality_adjustment}</p>
|
||||
|
|
@ -115,6 +115,21 @@
|
|||
<p class="x_text-info" cond="!function_exists('exif_read_data')">{$lang->msg_cannot_use_exif}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->image_remove_exif_data}</label>
|
||||
<div class="x_controls">
|
||||
<label for="image_remove_exif_data_Y" class="x_inline">
|
||||
<input type="radio" name="image_remove_exif_data" id="image_remove_exif_data_Y" value="Y" checked="checked"|cond="$config->image_remove_exif_data === true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label for="image_remove_exif_data_N" class="x_inline">
|
||||
<input type="radio" name="image_remove_exif_data" id="image_remove_exif_data_N" value="N" checked="checked"|cond="$config->image_remove_exif_data !== true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_image_remove_exif_data}</p>
|
||||
<p class="x_text-info" cond="!function_exists('exif_read_data')">{$lang->msg_cannot_use_exif}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->image_autoconv_gif2mp4}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
|
|
@ -95,6 +95,21 @@
|
|||
<p class="x_text-info" cond="!function_exists('exif_read_data')">{$lang->msg_cannot_use_exif}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->image_remove_exif_data}</label>
|
||||
<div class="x_controls">
|
||||
<label for="image_remove_exif_data_Y" class="x_inline">
|
||||
<input type="radio" name="image_remove_exif_data" id="image_remove_exif_data_Y" value="Y" checked="checked"|cond="$config->image_remove_exif_data === true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label for="image_remove_exif_data_N" class="x_inline">
|
||||
<input type="radio" name="image_remove_exif_data" id="image_remove_exif_data_N" value="N" checked="checked"|cond="$config->image_remove_exif_data !== true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_image_remove_exif_data}</p>
|
||||
<p class="x_text-info" cond="!function_exists('exif_read_data')">{$lang->msg_cannot_use_exif}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->image_autoconv_gif2mp4}</label>
|
||||
<div class="x_controls">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue