mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
움직이지 않는 gif도 mp4로 변환되는 문제 수정
FFmpeg 사용 불가 안내 메시지 추가 추후에 활용하기 위한 type, width, height, duration 컬럼 추가 업로드시 이미지, 오디오, 동영상 파일의 확장자가 잘못된 경우 올바른 확장자를 덧붙이는 기능 추가
This commit is contained in:
parent
cdbc2d7a82
commit
16e44d44c7
18 changed files with 331 additions and 180 deletions
|
|
@ -8,14 +8,43 @@ namespace Rhymix\Framework;
|
|||
class Image
|
||||
{
|
||||
/**
|
||||
* Check Check if file is an image
|
||||
* Check if a file is an image
|
||||
*
|
||||
* @param string $filename
|
||||
* @return bool
|
||||
*/
|
||||
public static function isImage($filename)
|
||||
{
|
||||
return strtolower(array_shift(explode('/', @mime_content_type($filename)))) === 'image';
|
||||
return array_shift(explode('/', Storage::getContentType($filename))) === 'image';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a file is an animated GIF.
|
||||
*
|
||||
* @param string $filename
|
||||
* @return bool
|
||||
*/
|
||||
public static function isAnimatedGIF($filename)
|
||||
{
|
||||
if (Storage::getContentType($filename) !== 'image/gif')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!$fp = @fopen($filename, 'rb'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$frames = 0;
|
||||
while (!feof($fp) && $frames < 2)
|
||||
{
|
||||
$frames += preg_match_all('#\x00\x21\xF9\x04.{4}\x00[\x2C\x21]#s', fread($fp, 1024 * 16) ?: '');
|
||||
if (!feof($fp))
|
||||
{
|
||||
fseek($fp, -9, SEEK_CUR);
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
return $frames > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -38,9 +67,9 @@ class Image
|
|||
'width' => $image_info[0],
|
||||
'height' => $image_info[1],
|
||||
'type' => image_type_to_extension($image_info[2], false),
|
||||
'bits' => $image_info['bits'],
|
||||
'channels' => $image_info['channels'],
|
||||
'mime' => $image_info['mime'],
|
||||
'bits' => $image_info['bits'] ?? null,
|
||||
'channels' => $image_info['channels'] ?? null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,6 +143,38 @@ class Storage
|
|||
return @self::exists($path) && @is_writable($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the MIME content type of a file.
|
||||
*
|
||||
* This method returns the MIME content type of a file, or false on error.
|
||||
*
|
||||
* @param string $filename
|
||||
* @return array|false
|
||||
*/
|
||||
public static function getContentType($filename)
|
||||
{
|
||||
$filename = rtrim($filename, '/\\');
|
||||
if (self::exists($filename) && @is_file($filename) && @is_readable($filename))
|
||||
{
|
||||
if (function_exists('mime_content_type'))
|
||||
{
|
||||
return @mime_content_type($filename) ?: false;
|
||||
}
|
||||
elseif (($image = @getimagesize($filename)) && $image['mime'])
|
||||
{
|
||||
return $image['mime'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return MIME::getTypeByFilename($filename);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the size of a file.
|
||||
*
|
||||
|
|
@ -499,6 +531,51 @@ class Storage
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move uploaded $source to $destination.
|
||||
*
|
||||
* This method returns true on success and false on failure.
|
||||
*
|
||||
* @param string $source
|
||||
* @param string $destination
|
||||
* @param string $type
|
||||
* @return bool
|
||||
*/
|
||||
public static function moveUploadedFile($source, $destination, $type = null)
|
||||
{
|
||||
if ($type === 'copy')
|
||||
{
|
||||
if (!self::copy($source, $destination))
|
||||
{
|
||||
if (!self::copy($source, $destination))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($type === 'move')
|
||||
{
|
||||
if (!self::move($source, $destination))
|
||||
{
|
||||
if (!self::move($source, $destination))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!@move_uploaded_file($source, $destination))
|
||||
{
|
||||
if (!@move_uploaded_file($source, $destination))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a file.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Rhymix\Framework;
|
||||
|
||||
/**
|
||||
* The video class.
|
||||
*/
|
||||
class Video
|
||||
{
|
||||
/**
|
||||
* Check Check if file is a video
|
||||
*
|
||||
* @param string $filename
|
||||
* @return bool
|
||||
*/
|
||||
public static function isVideo($filename)
|
||||
{
|
||||
return strtolower(array_shift(explode('/', @mime_content_type($filename)))) === 'video';
|
||||
}
|
||||
}
|
||||
|
|
@ -692,3 +692,22 @@ function is_empty_html_content($str)
|
|||
$str = utf8_trim(utf8_clean(html_entity_decode($str, ENT_QUOTES, 'UTF-8')));
|
||||
return $str === '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a external program can be executed.
|
||||
*
|
||||
* @param string $command
|
||||
* @return bool
|
||||
*/
|
||||
function is_command($command)
|
||||
{
|
||||
if ($command && function_exists('exec'))
|
||||
{
|
||||
@exec('ls ' . escapeshellarg($command), $output, $return_var);
|
||||
return $return_var === 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -158,7 +158,7 @@
|
|||
temp_code += '<audio src="' + result.download_url + '" controls data-file-srl="' + result.file_srl + '" />';
|
||||
}
|
||||
else if(/\.(mp4|webm|ogg)$/i.test(result.source_filename)) {
|
||||
if(result.original_type === 'gif') {
|
||||
if(result.original_type === 'image/gif') {
|
||||
temp_code += '<video src="' + result.download_url + '" autoplay loop muted data-file-srl="' + result.file_srl + '" />';
|
||||
} else {
|
||||
temp_code += '<video src="' + result.download_url + '" controls data-file-srl="' + result.file_srl + '" />';
|
||||
|
|
@ -330,7 +330,7 @@
|
|||
temp_code += '<audio src="' + result.download_url + '" controls data-file-srl="' + result.file_srl + '" />';
|
||||
}
|
||||
else if(/\.(mp4|webm|ogg)$/i.test(result.source_filename)) {
|
||||
if(result.original_type === 'gif') {
|
||||
if(result.original_type === 'image/gif') {
|
||||
temp_code += '<video src="' + result.download_url + '" autoplay loop muted data-file-srl="' + result.file_srl + '" />';
|
||||
} else {
|
||||
temp_code += '<video src="' + result.download_url + '" controls data-file-srl="' + result.file_srl + '" />';
|
||||
|
|
|
|||
|
|
@ -358,3 +358,4 @@ $lang->audio = 'Audio';
|
|||
$lang->video = 'Video';
|
||||
$lang->text = 'Text';
|
||||
$lang->image_quality = 'Quality';
|
||||
$lang->standard = 'Standard';
|
||||
|
|
|
|||
|
|
@ -362,3 +362,4 @@ $lang->audio = '오디오';
|
|||
$lang->video = '동영상';
|
||||
$lang->text = '텍스트';
|
||||
$lang->image_quality = '화질';
|
||||
$lang->standard = '표준';
|
||||
|
|
|
|||
|
|
@ -218,7 +218,8 @@ class fileAdminView extends file
|
|||
{
|
||||
$oFileModel = getModel('file');
|
||||
$config = $oFileModel->getFileConfig();
|
||||
Context::set('config',$config);
|
||||
Context::set('config', $config);
|
||||
Context::set('is_ffmpeg', is_command($config->ffmpeg_command) && is_command($config->ffprobe_command));
|
||||
|
||||
// Set a template file
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
|
|
|||
|
|
@ -85,11 +85,27 @@ class file extends ModuleObject
|
|||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'thumbnail_filename'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'type'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'original_type'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'thumbnail_filename'))
|
||||
if(!$oDB->isColumnExists('files', 'width'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'height'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'duration'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
@ -168,13 +184,30 @@ class file extends ModuleObject
|
|||
{
|
||||
$oModuleController->insertTrigger('comment.copyCommentByDocument', 'file', 'controller', 'triggerAddCopyCommentByDocument', 'add');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'original_type'))
|
||||
{
|
||||
$oDB->addColumn('files', 'original_type', 'varchar', '60');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'thumbnail_filename'))
|
||||
{
|
||||
$oDB->addColumn('files', 'thumbnail_filename', 'varchar', '250');
|
||||
$oDB->addColumn('files', 'thumbnail_filename', 'varchar', '250', null, false, 'uploaded_filename');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'type'))
|
||||
{
|
||||
$oDB->addColumn('files', 'type', 'varchar', '60', '', true, 'thumbnail_filename');
|
||||
$oDB->addIndex('files', 'idx_type', 'type');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'original_type'))
|
||||
{
|
||||
$oDB->addColumn('files', 'original_type', 'varchar', '60', null, false, 'type');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'width'))
|
||||
{
|
||||
$oDB->addColumn('files', 'width', 'number', '11', null, false, 'original_type');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'height'))
|
||||
{
|
||||
$oDB->addColumn('files', 'height', 'number', '11', null, false, 'width');
|
||||
}
|
||||
if(!$oDB->isColumnExists('files', 'duration'))
|
||||
{
|
||||
$oDB->addColumn('files', 'duration', 'number', '11', null, false, 'height');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -873,27 +873,44 @@ class fileController extends file
|
|||
$file_info['name'] = base64_decode(strtr($match[1], ':', '/'));
|
||||
}
|
||||
|
||||
// Sanitize filename
|
||||
// Set base information
|
||||
$file_info['name'] = Rhymix\Framework\Filters\FilenameFilter::clean($file_info['name']);
|
||||
|
||||
// Add extra fields to file info array
|
||||
$file_info['extension'] = $file_info['original_type'] = $this->getExtension($file_info['name']);
|
||||
$file_info['converted'] = false;
|
||||
$file_info['type'] = $file_info['original_type'] = Rhymix\Framework\Storage::getContentType($file_info['tmp_name']);
|
||||
$file_info['extension'] = $file_info['original_extension'] = strtolower(array_pop(explode('.', $file_info['name'])));
|
||||
$file_info['width'] = null;
|
||||
$file_info['height'] = null;
|
||||
$file_info['duration'] = null;
|
||||
$file_info['thumbnail'] = null;
|
||||
$file_info['converted'] = false;
|
||||
|
||||
// Correct extension
|
||||
if($extension_by_type = Rhymix\Framework\MIME::getExtensionByType($file_info['type']))
|
||||
{
|
||||
$target_types = ['image', 'audio', 'video'];
|
||||
if(in_array(array_shift(explode('/', $file_info['type'])), $target_types))
|
||||
{
|
||||
$file_info['extension'] = $extension_by_type;
|
||||
}
|
||||
elseif($file_info['extension'])
|
||||
{
|
||||
$type_by_extension = Rhymix\Framework\MIME::getTypeByExtension($file_info['extension']);
|
||||
if(in_array(array_shift(explode('/', $type_by_extension)), $target_types))
|
||||
{
|
||||
$file_info['extension'] = $extension_by_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get file module configuration
|
||||
$oFileModel = getModel('file');
|
||||
$config = $oFileModel->getFileConfig($module_srl);
|
||||
|
||||
// Check file type
|
||||
// Check file extension
|
||||
if(!$manual_insert && !$this->user->isAdmin())
|
||||
{
|
||||
if(isset($config->allowed_extensions) && count($config->allowed_extensions))
|
||||
if($config->allowed_extensions && !in_array($file_info['extension'], $config->allowed_extensions))
|
||||
{
|
||||
if(!in_array($file_info['extension'], $config->allowed_extensions))
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_not_allowed_filetype');
|
||||
}
|
||||
throw new Rhymix\Framework\Exception('msg_not_allowed_filetype');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -942,14 +959,24 @@ class fileController extends file
|
|||
$args->member_srl = Rhymix\Framework\Session::getMemberSrl();
|
||||
$args->source_filename = $file_info['name'];
|
||||
$args->sid = Rhymix\Framework\Security::getRandom(32, 'hex');
|
||||
$args->type = $file_info['type'];
|
||||
$args->width = $file_info['width'];
|
||||
$args->height = $file_info['height'];
|
||||
$args->duration = $file_info['duration'];
|
||||
|
||||
// Set original type if filename extension is changed
|
||||
// Set original type if file type is changed
|
||||
$args->original_type = null;
|
||||
if($file_info['extension'] !== $file_info['original_type'])
|
||||
if($args->type !== $file_info['original_type'])
|
||||
{
|
||||
$args->original_type = $file_info['original_type'];
|
||||
}
|
||||
|
||||
// Add changed extension
|
||||
if($file_info['extension'] && $file_info['extension'] !== $file_info['original_extension'])
|
||||
{
|
||||
$args->source_filename .= '.' . $file_info['extension'];
|
||||
}
|
||||
|
||||
// Set storage path by checking if the attachement is an image or other kinds of file
|
||||
if($direct = Rhymix\Framework\Filters\FilenameFilter::isDirectDownload($args->source_filename))
|
||||
{
|
||||
|
|
@ -967,24 +994,39 @@ class fileController extends file
|
|||
throw new Rhymix\Framework\Exception('msg_not_permitted_create');
|
||||
}
|
||||
|
||||
// Upload file
|
||||
$method = $manual_insert ? 'copy' : '';
|
||||
if(starts_with(RX_BASEDIR . 'files/attach/chunks/', $file_info['tmp_name']) || $file_info['converted'])
|
||||
// Set move type and uploaded filename
|
||||
$move_type = $manual_insert ? 'copy' : '';
|
||||
if($file_info['converted'] || starts_with(RX_BASEDIR . 'files/attach/chunks/', $file_info['tmp_name']))
|
||||
{
|
||||
$method = 'move';
|
||||
$move_type = 'move';
|
||||
}
|
||||
if(!$uploaded_filename = $this->uploadFile($file_info['tmp_name'], $args->source_filename, $storage_path, $direct, $method))
|
||||
$extension = ($direct && $file_info['extension']) ? ('.' . $file_info['extension']) : '';
|
||||
$uploaded_filename = $storage_path . Rhymix\Framework\Security::getRandom(32, 'hex') . $extension;
|
||||
while(file_exists($uploaded_filename))
|
||||
{
|
||||
$uploaded_filename = $storage_path . Rhymix\Framework\Security::getRandom(32, 'hex') . $extension;
|
||||
}
|
||||
|
||||
// Move the uploaded file
|
||||
if(!Rhymix\Framework\Storage::moveUploadedFile($file_info['tmp_name'], $uploaded_filename, $move_type))
|
||||
{
|
||||
throw new Rhymix\Framework\Exception('msg_file_upload_error');
|
||||
}
|
||||
$args->uploaded_filename = './' . substr($uploaded_filename, strlen(RX_BASEDIR));
|
||||
$args->file_size = @filesize($uploaded_filename);
|
||||
|
||||
// Upload thumbnail
|
||||
// Move the created thumbnail image
|
||||
if($file_info['thumbnail'])
|
||||
{
|
||||
$thumbnail_filename = $this->uploadFile($file_info['thumbnail'], 'thumbnail.jpg', $storage_path, true, 'move');
|
||||
$args->thumbnail_filename = './' . substr($thumbnail_filename, strlen(RX_BASEDIR));
|
||||
$thumbnail_filename = $storage_path . Rhymix\Framework\Security::getRandom(32, 'hex') . '.jpg';
|
||||
while(file_exists($thumbnail_filename))
|
||||
{
|
||||
$thumbnail_filename = $storage_path . Rhymix\Framework\Security::getRandom(32, 'hex') . '.jpg';
|
||||
}
|
||||
if(Rhymix\Framework\Storage::moveUploadedFile($file_info['thumbnail'], $thumbnail_filename, 'move'))
|
||||
{
|
||||
$args->thumbnail_filename = './' . substr($thumbnail_filename, strlen(RX_BASEDIR));
|
||||
}
|
||||
}
|
||||
|
||||
$oDB = DB::getInstance();
|
||||
|
|
@ -1037,60 +1079,6 @@ class fileController extends file
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload file
|
||||
*/
|
||||
public function uploadFile($tmp_name, $file_name, $storage_path, $direct = false, $method = '')
|
||||
{
|
||||
// change to random file name.
|
||||
// because window php bug. window php is not recognize unicode character file name - by cherryfilter
|
||||
$uploaded_filename = $storage_path . Rhymix\Framework\Security::getRandom(32, 'hex');
|
||||
while(file_exists($uploaded_filename))
|
||||
{
|
||||
$uploaded_filename = $storage_path . Rhymix\Framework\Security::getRandom(32, 'hex');
|
||||
}
|
||||
if($direct)
|
||||
{
|
||||
$uploaded_filename .= '.' . $this->getExtension($file_name);
|
||||
}
|
||||
|
||||
// move the file
|
||||
if($method === 'copy')
|
||||
{
|
||||
@copy($tmp_name, $uploaded_filename);
|
||||
if(!file_exists($uploaded_filename))
|
||||
{
|
||||
@copy($tmp_name, $uploaded_filename);
|
||||
if(!file_exists($uploaded_filename))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($method === 'move')
|
||||
{
|
||||
if (!Rhymix\Framework\Storage::move($tmp_name, $uploaded_filename))
|
||||
{
|
||||
if (!Rhymix\Framework\Storage::move($tmp_name, $uploaded_filename))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!@move_uploaded_file($tmp_name, $uploaded_filename))
|
||||
{
|
||||
if(!@move_uploaded_file($tmp_name, $uploaded_filename))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $uploaded_filename;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjust uploaded image
|
||||
*/
|
||||
|
|
@ -1102,6 +1090,11 @@ class fileController extends file
|
|||
return $file_info;
|
||||
}
|
||||
|
||||
// Set image size
|
||||
$file_info['width'] = $image_info['width'];
|
||||
$file_info['height'] = $image_info['height'];
|
||||
|
||||
// Set base information
|
||||
$adjusted = [
|
||||
'width' => $image_info['width'],
|
||||
'height' => $image_info['height'],
|
||||
|
|
@ -1109,9 +1102,10 @@ class fileController extends file
|
|||
'quality' => $config->image_quality_adjustment,
|
||||
'rotate' => 0,
|
||||
];
|
||||
$is_animated = Rhymix\Framework\Image::isAnimatedGIF($file_info['tmp_name']);
|
||||
|
||||
// Adjust image type
|
||||
if ($config->image_autoconv['gif2mp4'] && $image_info['type'] === 'gif' && function_exists('exec'))
|
||||
if ($config->image_autoconv['gif2mp4'] && $is_animated && is_command($config->ffmpeg_command))
|
||||
{
|
||||
$adjusted['type'] = 'mp4';
|
||||
}
|
||||
|
|
@ -1189,13 +1183,12 @@ class fileController extends file
|
|||
{
|
||||
$message = sprintf(lang('msg_exceeds_max_image_height'), $config->max_image_height);
|
||||
}
|
||||
|
||||
throw new Rhymix\Framework\Exception($message);
|
||||
}
|
||||
|
||||
$adjusted['width'] = (int)$resize_width;
|
||||
$adjusted['height'] = (int)$resize_height;
|
||||
if ($image_info['type'] !== 'gif')
|
||||
if (!$is_animated && $adjusted['type'] === $image_info['type'])
|
||||
{
|
||||
$adjusted['type'] = 'jpg';
|
||||
}
|
||||
|
|
@ -1203,18 +1196,23 @@ class fileController extends file
|
|||
}
|
||||
|
||||
// Convert image if adjusted
|
||||
if ($image_info['width'] !== $adjusted['width'] || $image_info['height'] !== $adjusted['height'] || $image_info['type'] !== $adjusted['type'] || $adjusted['rotate'])
|
||||
if (
|
||||
$adjusted['width'] !== $image_info['width'] ||
|
||||
$adjusted['height'] !== $image_info['height'] ||
|
||||
$adjusted['type'] !== $image_info['type'] ||
|
||||
$adjusted['rotate'] !== 0
|
||||
)
|
||||
{
|
||||
$output_name = $file_info['tmp_name'] . '.converted.' . $adjusted['type'];
|
||||
|
||||
// Create output
|
||||
// Generate an output file
|
||||
if ($adjusted['type'] === 'mp4')
|
||||
{
|
||||
$adjusted['width'] -= $adjusted['width'] % 2;
|
||||
$adjusted['height'] -= $adjusted['height'] % 2;
|
||||
|
||||
// Convert using ffmpeg
|
||||
$command = $config->ffmpeg_command ?: '/usr/bin/ffmpeg';
|
||||
$command = $config->ffmpeg_command;
|
||||
$command .= ' -i ' . escapeshellarg($file_info['tmp_name']);
|
||||
$command .= ' -movflags +faststart -pix_fmt yuv420p -c:v libx264 -crf 23';
|
||||
$command .= sprintf(' -vf "scale=%d:%d"', $adjusted['width'], $adjusted['height']);
|
||||
|
|
@ -1222,7 +1220,7 @@ class fileController extends file
|
|||
@exec($command, $output, $return_var);
|
||||
$result = $return_var === 0 ? true : false;
|
||||
|
||||
// Create thumbnail
|
||||
// Generate a thumbnail image
|
||||
if ($result)
|
||||
{
|
||||
$file_info['thumbnail'] = $file_info['tmp_name'] . '.thumbnail.jpg';
|
||||
|
|
@ -1237,10 +1235,12 @@ class fileController extends file
|
|||
// Change to information in the output file
|
||||
if ($result)
|
||||
{
|
||||
$file_info['name'] = preg_replace('/\.' . preg_quote($file_info['extension'], '/') . '$/i', '.' . $adjusted['type'], $file_info['name']);
|
||||
$file_info['tmp_name'] = $output_name;
|
||||
$file_info['size'] = filesize($file_info['tmp_name']);
|
||||
$file_info['size'] = filesize($output_name);
|
||||
$file_info['type'] = Rhymix\Framework\Storage::getContentType($output_name);
|
||||
$file_info['extension'] = $adjusted['type'];
|
||||
$file_info['width'] = $adjusted['width'];
|
||||
$file_info['height'] = $adjusted['height'];
|
||||
$file_info['converted'] = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1253,17 +1253,17 @@ class fileController extends file
|
|||
*/
|
||||
public function adjustUploadedVideo($file_info, $config)
|
||||
{
|
||||
if (!Rhymix\Framework\Video::isVideo($file_info['tmp_name']))
|
||||
if (!is_command($config->ffmpeg_command) || !is_command($config->ffprobe_command))
|
||||
{
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
// Create thumbnail
|
||||
// Generate a thumbnail image
|
||||
if ($config->video_thumbnail)
|
||||
{
|
||||
$output_name = $file_info['tmp_name'] . '.thumbnail.jpeg';
|
||||
|
||||
$command = $config->ffmpeg_command ?: '/usr/bin/ffmpeg';
|
||||
$command = $config->ffmpeg_command;
|
||||
$command .= sprintf(' -ss 00:00:00.%d -i %s -vframes 1', mt_rand(0, 99), escapeshellarg($file_info['tmp_name']));
|
||||
$command .= ' ' . escapeshellarg($output_name);
|
||||
@exec($command, $output, $return_var);
|
||||
|
|
@ -1277,19 +1277,19 @@ class fileController extends file
|
|||
// Treat as GIF
|
||||
if ($config->video_mp4_gif_time && $file_info['extension'] === 'mp4')
|
||||
{
|
||||
$command = $config->ffprobe_command ?: '/usr/bin/ffprobe';
|
||||
$command = $config->ffprobe_command;
|
||||
$command .= ' -i ' . escapeshellarg($file_info['tmp_name']);
|
||||
$command .= ' -show_entries format=duration -v quiet -of csv="p=0"';
|
||||
$duration = (int)floor(@exec($command));
|
||||
if($duration <= $config->video_mp4_gif_time)
|
||||
$file_info['duration'] = (int)floor(@exec($command));
|
||||
if($file_info['duration'] <= $config->video_mp4_gif_time)
|
||||
{
|
||||
$file_info['original_type'] = 'gif';
|
||||
$file_info['original_type'] = 'image/gif';
|
||||
}
|
||||
}
|
||||
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete the attachment
|
||||
*
|
||||
|
|
@ -1653,11 +1653,6 @@ class fileController extends file
|
|||
}
|
||||
}
|
||||
|
||||
public function getExtension($file_name)
|
||||
{
|
||||
return strtolower(array_pop(explode('.', $file_name)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the attachment where a key is upload_target_srl and then return java script code
|
||||
*
|
||||
|
|
|
|||
|
|
@ -197,10 +197,10 @@ class fileModel extends file
|
|||
$config->download_grant = $config->download_grant ?? [];
|
||||
$config->inline_download_format = $config->inline_download_format ?? [];
|
||||
$config->image_autoconv = $config->image_autoconv ?? [];
|
||||
$config->image_quality_adjustment = $config->image_quality_adjustment ?? 100;
|
||||
$config->image_quality_adjustment = $config->image_quality_adjustment ?? 75;
|
||||
$config->video_mp4_gif_time = $config->video_mp4_gif_time ?? 0;
|
||||
$config->ffmpeg_command = $config->ffmpeg_command ?? '/usr/bin/ffmpeg';
|
||||
$config->ffprobe_command = $config->ffprobe_command ?? '/usr/bin/ffmpeg';
|
||||
$config->ffprobe_command = $config->ffprobe_command ?? '/usr/bin/ffprobe';
|
||||
|
||||
// Format allowed_filetypes
|
||||
$config->allowed_filetypes = $config->allowed_filetypes ?? '*.*';
|
||||
|
|
|
|||
|
|
@ -24,27 +24,30 @@ class fileView extends file
|
|||
function triggerDispFileAdditionSetup(&$obj)
|
||||
{
|
||||
$current_module_srl = Context::get('module_srl');
|
||||
$current_module_srls = Context::get('module_srls');
|
||||
|
||||
if(!$current_module_srl && !$current_module_srls)
|
||||
if(!$current_module_srl)
|
||||
{
|
||||
// Get information of the current module
|
||||
$current_module_info = Context::get('current_module_info');
|
||||
$current_module_srl = $current_module_info->module_srl;
|
||||
if(!$current_module_srl) return;
|
||||
$current_module_srl = Context::get('current_module_info')->module_srl;
|
||||
if(!$current_module_srl)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Get file configurations of the module
|
||||
$oFileModel = getModel('file');
|
||||
$file_config = $oFileModel->getFileModuleConfig($current_module_srl);
|
||||
Context::set('file_config', $file_config);
|
||||
$config = $oFileModel->getFileConfig($current_module_srl);
|
||||
Context::set('config', $config);
|
||||
Context::set('is_ffmpeg', is_command($config->ffmpeg_command) && is_command($config->ffprobe_command));
|
||||
|
||||
// Get a permission for group setting
|
||||
$oMemberModel = getModel('member');
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$group_list = $oMemberModel->getGroups($site_module_info->site_srl);
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
// Set a template file
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'file_module_config');
|
||||
$oTemplate = TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path . 'tpl', 'file_module_config');
|
||||
$obj .= $tpl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@ $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->original_image_quality = 'Original Quality';
|
||||
$lang->image_autorotate = 'Fix Image Rotation';
|
||||
$lang->about_image_autorotate = 'correct images that are rotated by mobile devices.';
|
||||
$lang->image_autoconv_gif2mp4 = 'Convert GIF';
|
||||
|
|
@ -99,4 +98,4 @@ $lang->video_mp4_gif_time = 'Treat as GIF';
|
|||
$lang->about_video_mp4_gif_time = 'treat MP4 videos with duration less than the set time as GIF images, and play with auto and loop.';
|
||||
$lang->ffmpeg_path = 'FFmpeg path';
|
||||
$lang->ffprobe_path = 'FFprobe path';
|
||||
$lang->msg_cannot_use_ffmpeg = 'FFmpeg must be available in PHP';
|
||||
$lang->msg_cannot_use_ffmpeg = 'FFmpeg and FFprobe must can be executed by PHP';
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ $lang->max_image_size_action_resize = '초과시 자동 크기 조정';
|
|||
$lang->max_image_size_admin = '관리자에게도 적용';
|
||||
$lang->image_quality_adjustment = '이미지 화질';
|
||||
$lang->about_image_quality_adjustment = '업로드된 이미지의 화질을 조정합니다.';
|
||||
$lang->original_image_quality = '원본 화질';
|
||||
$lang->image_autorotate = '이미지 회전 수정';
|
||||
$lang->about_image_autorotate = '모바일 기기 등에서 잘못 회전된 이미지를 바로잡습니다.';
|
||||
$lang->image_autoconv_gif2mp4 = 'GIF 변환';
|
||||
|
|
@ -100,4 +99,4 @@ $lang->video_mp4_gif_time = 'GIF로 취급';
|
|||
$lang->about_video_mp4_gif_time = '설정된 시간 이하의 길이를 가진 짧은 MP4 동영상을 GIF 이미지로 취급하여 자동 및 반복 재생 상태로 삽입합니다.';
|
||||
$lang->ffmpeg_path = 'FFmpeg 경로';
|
||||
$lang->ffprobe_path = 'FFprobe 경로';
|
||||
$lang->msg_cannot_use_ffmpeg = 'PHP에서 FFmpeg를 사용할 수 있어야 합니다.';
|
||||
$lang->msg_cannot_use_ffmpeg = 'PHP에서 FFmpeg 및 FFprobe를 실행할 수 있어야 합니다.';
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@
|
|||
<column name="source_filename" var="source_filename" notnull="notnull" minlength="1" maxlength="250" />
|
||||
<column name="uploaded_filename" var="uploaded_filename" notnull="notnull" minlength="1" maxlength="250" />
|
||||
<column name="thumbnail_filename" var="thumbnail_filename" />
|
||||
<column name="type" var="type" notnull="notnull" />
|
||||
<column name="original_type" var="original_type" />
|
||||
<column name="width" var="width" />
|
||||
<column name="height" var="height" />
|
||||
<column name="duration" var="duration" />
|
||||
<column name="file_size" var="file_size" notnull="notnull" default="0" />
|
||||
<column name="direct_download" var="direct_download" notnull="notnull" default="N" />
|
||||
<column name="comment" var="comment" />
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@
|
|||
<column name="source_filename" type="varchar" size="250" />
|
||||
<column name="uploaded_filename" type="varchar" size="250" />
|
||||
<column name="thumbnail_filename" type="varchar" size="250" />
|
||||
<column name="type" type="varchar" size="60" notnull="notnull" index="idx_type" />
|
||||
<column name="original_type" type="varchar" size="60" />
|
||||
<column name="width" type="number" size="11" />
|
||||
<column name="height" type="number" size="11" />
|
||||
<column name="duration" type="number" size="11" />
|
||||
<column name="file_size" type="number" size="11" default="0" notnull="notnull" index="idx_file_size" />
|
||||
<column name="comment" type="varchar" size="250" />
|
||||
<column name="isvalid" type="char" size="1" default="N" index="idx_is_valid" />
|
||||
|
|
|
|||
|
|
@ -14,30 +14,30 @@
|
|||
<label class="x_control-label">{$lang->use_default_file_config}</label>
|
||||
<div class="x_controls">
|
||||
<label for="use_default_file_config" class="x_inline">
|
||||
<input type="checkbox" name="use_default_file_config" id="use_default_file_config" value="Y" checked="checked"|cond="$file_config->use_default_file_config !== 'N'" />
|
||||
<input type="checkbox" name="use_default_file_config" id="use_default_file_config" value="Y" checked="checked"|cond="$config->use_default_file_config !== 'N'" />
|
||||
{$lang->about_use_default_file_config}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="use_custom_file_config" style="display:none"|cond="$file_config->use_default_file_config !== 'N'">
|
||||
<div class="use_custom_file_config" style="display:none"|cond="$config->use_default_file_config !== 'N'">
|
||||
<div class="x_control-group">
|
||||
<label for="allowed_filesize" class="x_control-label">{$lang->allowed_filesize}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="allowed_filesize" id="allowed_filesize" value="{$file_config->allowed_filesize}" size="7" style="min-width:80px" /> MB
|
||||
<input type="number" min="0" name="allowed_filesize" id="allowed_filesize" value="{$config->allowed_filesize}" size="7" style="min-width:80px" /> MB
|
||||
<p class="x_help-block">{sprintf($lang->about_allowed_filesize, getUrl('', 'module', 'admin', 'act', 'dispFileAdminConfig'))}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="allowed_attach_size" class="x_control-label">{$lang->allowed_attach_size}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="allowed_attach_size" id="allowed_attach_size" value="{$file_config->allowed_attach_size}" size="7" style="min-width:80px" /> MB
|
||||
<input type="number" min="0" name="allowed_attach_size" id="allowed_attach_size" value="{$config->allowed_attach_size}" size="7" style="min-width:80px" /> MB
|
||||
<p class="x_help-block">{sprintf($lang->about_allowed_attach_size, getUrl('', 'module', 'admin', 'act', 'dispFileAdminConfig'))}<br />{sprintf($lang->about_allowed_size_limits, ini_get('upload_max_filesize'))}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label for="allowed_filetypes" class="x_control-label">{$lang->allowed_filetypes}</label>
|
||||
<div class="x_controls">
|
||||
<input type="text" name="allowed_filetypes" id="allowed_filetypes" value="{implode(', ', $file_config->allowed_extensions)}" />
|
||||
<input type="text" name="allowed_filetypes" id="allowed_filetypes" value="{implode(', ', $config->allowed_extensions)}" />
|
||||
<p class="x_help-block">{$lang->about_allowed_filetypes}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -46,25 +46,25 @@
|
|||
<label class="x_control-label">{$lang->use_image_default_file_config}</label>
|
||||
<div class="x_controls">
|
||||
<label for="use_image_default_file_config" class="x_inline">
|
||||
<input type="checkbox" name="use_image_default_file_config" id="use_image_default_file_config" value="Y" checked="checked"|cond="$file_config->use_image_default_file_config !== 'N'" />
|
||||
<input type="checkbox" name="use_image_default_file_config" id="use_image_default_file_config" value="Y" checked="checked"|cond="$config->use_image_default_file_config !== 'N'" />
|
||||
{$lang->about_use_image_default_file_config}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="use_custom_image_file_config" style="display:none"|cond="$file_config->use_image_default_file_config !== 'N'">
|
||||
<div class="use_custom_image_file_config" style="display:none"|cond="$config->use_image_default_file_config !== 'N'">
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->image_autoconv}</label>
|
||||
<div class="x_controls">
|
||||
<label for="image_autoconv_bmp2jpg">
|
||||
<input type="checkbox" name="image_autoconv_bmp2jpg" id="image_autoconv_bmp2jpg" value="Y" checked="checked"|cond="$file_config->image_autoconv['bmp2jpg']" disabled="disabled"|cond="!function_exists('imagebmp')" />
|
||||
<input type="checkbox" name="image_autoconv_bmp2jpg" id="image_autoconv_bmp2jpg" value="Y" checked="checked"|cond="$config->image_autoconv['bmp2jpg']" disabled="disabled"|cond="!function_exists('imagebmp')" />
|
||||
{$lang->image_autoconv_bmp2jpg}
|
||||
</label>
|
||||
<label for="image_autoconv_png2jpg">
|
||||
<input type="checkbox" name="image_autoconv_png2jpg" id="image_autoconv_png2jpg" value="Y" checked="checked"|cond="$file_config->image_autoconv['png2jpg']" disabled="disabled"|cond="!function_exists('imagepng')" />
|
||||
<input type="checkbox" name="image_autoconv_png2jpg" id="image_autoconv_png2jpg" value="Y" checked="checked"|cond="$config->image_autoconv['png2jpg']" disabled="disabled"|cond="!function_exists('imagepng')" />
|
||||
{$lang->image_autoconv_png2jpg}
|
||||
</label>
|
||||
<label for="image_autoconv_webp2jpg">
|
||||
<input type="checkbox" name="image_autoconv_webp2jpg" id="image_autoconv_webp2jpg" value="Y" checked="checked"|cond="$file_config->image_autoconv['webp2jpg']" disabled="disabled"|cond="!function_exists('imagewebp')" />
|
||||
<input type="checkbox" name="image_autoconv_webp2jpg" id="image_autoconv_webp2jpg" value="Y" checked="checked"|cond="$config->image_autoconv['webp2jpg']" disabled="disabled"|cond="!function_exists('imagewebp')" />
|
||||
{$lang->image_autoconv_webp2jpg}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_image_autoconv}</p>
|
||||
|
|
@ -73,17 +73,17 @@
|
|||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->max_image_size}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="max_image_width" id="max_image_width" value="{$file_config->max_image_width}" size="7" style="min-width:80px" /> ×
|
||||
<input type="number" min="0" name="max_image_height" id="max_image_height" value="{$file_config->max_image_height}" size="7" style="min-width:80px" /> px
|
||||
<input type="number" min="0" name="max_image_width" id="max_image_width" value="{$config->max_image_width}" size="7" style="min-width:80px" /> ×
|
||||
<input type="number" min="0" name="max_image_height" id="max_image_height" value="{$config->max_image_height}" size="7" style="min-width:80px" /> px
|
||||
<select name="max_image_size_action" id="max_image_size_action">
|
||||
<option value="">{$lang->max_image_size_action_nothing}</option>
|
||||
<option value="block" selected="selected"|cond="$file_config->max_image_size_action === 'block'">{$lang->max_image_size_action_block}</option>
|
||||
<option value="resize" selected="selected"|cond="$file_config->max_image_size_action === 'resize'">{$lang->max_image_size_action_resize}</option>
|
||||
<option value="block" selected="selected"|cond="$config->max_image_size_action === 'block'">{$lang->max_image_size_action_block}</option>
|
||||
<option value="resize" selected="selected"|cond="$config->max_image_size_action === 'resize'">{$lang->max_image_size_action_resize}</option>
|
||||
</select>
|
||||
<p class="x_help-block">
|
||||
{$lang->about_max_image_size}
|
||||
<label for="max_image_size_admin">
|
||||
<input type="checkbox" name="max_image_size_admin" id="max_image_size_admin" value="Y" checked="checked"|cond="$file_config->max_image_size_admin === 'Y'" />
|
||||
<input type="checkbox" name="max_image_size_admin" id="max_image_size_admin" value="Y" checked="checked"|cond="$config->max_image_size_admin === 'Y'" />
|
||||
{$lang->max_image_size_admin}
|
||||
</label>
|
||||
</p>
|
||||
|
|
@ -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="$file_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"><!--@if($q === 100)-->{$lang->original_image_quality}<!--@else-->{$q}%<!--@end--></option>
|
||||
<!--@endfor-->
|
||||
</select>
|
||||
<p class="x_help-block">{$lang->about_image_quality_adjustment}</p>
|
||||
|
|
@ -104,11 +104,11 @@
|
|||
<label class="x_control-label">{$lang->image_autorotate}</label>
|
||||
<div class="x_controls">
|
||||
<label for="image_autorotate_Y" class="x_inline">
|
||||
<input type="radio" name="image_autorotate" id="image_autorotate_Y" value="Y" checked="checked"|cond="$file_config->image_autorotate === true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
<input type="radio" name="image_autorotate" id="image_autorotate_Y" value="Y" checked="checked"|cond="$config->image_autorotate === true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label for="image_autorotate_N" class="x_inline">
|
||||
<input type="radio" name="image_autorotate" id="image_autorotate_N" value="N" checked="checked"|cond="$file_config->image_autorotate !== true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
<input type="radio" name="image_autorotate" id="image_autorotate_N" value="N" checked="checked"|cond="$config->image_autorotate !== true" disabled="disabled"|cond="!function_exists('exif_read_data')" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_image_autorotate}</p>
|
||||
|
|
@ -118,14 +118,15 @@
|
|||
<label class="x_control-label">{$lang->image_autoconv_gif2mp4}</label>
|
||||
<div class="x_controls">
|
||||
<label for="image_autoconv_gif2mp4_Y" class="x_inline">
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_Y" value="Y" checked="checked"|cond="$file_config->image_autoconv['gif2mp4'] === true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_Y" value="Y" checked="checked"|cond="$config->image_autoconv['gif2mp4'] === true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label for="image_autoconv_gif2mp4_N" class="x_inline">
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_N" value="N" checked="checked"|cond="$file_config->image_autoconv['gif2mp4'] !== true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_N" value="N" checked="checked"|cond="$config->image_autoconv['gif2mp4'] !== true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_image_autoconv_gif2mp4}</p>
|
||||
<p class="x_text-info" cond="!$is_ffmpeg">{$lang->msg_cannot_use_ffmpeg}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -133,38 +134,40 @@
|
|||
<label class="x_control-label">{$lang->use_video_default_file_config}</label>
|
||||
<div class="x_controls">
|
||||
<label for="use_video_default_file_config" class="x_inline">
|
||||
<input type="checkbox" name="use_video_default_file_config" id="use_video_default_file_config" value="Y" checked="checked"|cond="$file_config->use_video_default_file_config !== 'N'" />
|
||||
<input type="checkbox" name="use_video_default_file_config" id="use_video_default_file_config" value="Y" checked="checked"|cond="$config->use_video_default_file_config !== 'N'" />
|
||||
{$lang->about_use_video_default_file_config}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="use_custom_video_file_config" style="display:none"|cond="$file_config->use_video_default_file_config !== 'N'">
|
||||
<div class="use_custom_video_file_config" style="display:none"|cond="$config->use_video_default_file_config !== 'N'">
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->video_thumbnail}</label>
|
||||
<div class="x_controls">
|
||||
<label for="video_thumbnail_Y" class="x_inline">
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_Y" value="Y" checked="checked"|cond="$file_config->video_thumbnail === true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_Y" value="Y" checked="checked"|cond="$config->video_thumbnail === true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label for="video_thumbnail_N" class="x_inline">
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_N" value="N" checked="checked"|cond="$file_config->video_thumbnail !== true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_N" value="N" checked="checked"|cond="$config->video_thumbnail !== true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_video_thumbnail}</p>
|
||||
<p class="x_text-info" cond="!$is_ffmpeg">{$lang->msg_cannot_use_ffmpeg}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->video_mp4_gif_time}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="video_mp4_gif_time" value="{$file_config->video_mp4_gif_time}" style="min-width:80px" disabled="disabled"|cond="!function_exists('exec')" /> {$lang->unit_sec}
|
||||
<input type="number" min="0" name="video_mp4_gif_time" value="{$config->video_mp4_gif_time}" style="min-width:80px" disabled="disabled"|cond="!$is_ffmpeg" /> {$lang->unit_sec}
|
||||
<p class="x_help-block">{$lang->about_video_mp4_gif_time}</p>
|
||||
<p class="x_text-info" cond="!$is_ffmpeg">{$lang->msg_cannot_use_ffmpeg}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->enable_download_group}</label>
|
||||
<div class="x_controls">
|
||||
<label loop="$group_list => $k, $v" for="grant_{$key}_{$v->group_srl}"><input type="checkbox" name="download_grant[]" value="{$v->group_srl}" id="grant_{$key}_{$v->group_srl}" checked="checked"|cond="in_array($v->group_srl, $file_config->download_grant)" /> {$v->title}</label>
|
||||
<label loop="$group_list => $k, $v" for="grant_{$key}_{$v->group_srl}"><input type="checkbox" name="download_grant[]" value="{$v->group_srl}" id="grant_{$key}_{$v->group_srl}" checked="checked"|cond="in_array($v->group_srl, $config->download_grant)" /> {$v->title}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
|
|
|
|||
|
|
@ -74,7 +74,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>
|
||||
|
|
@ -98,14 +98,15 @@
|
|||
<label class="x_control-label">{$lang->image_autoconv_gif2mp4}</label>
|
||||
<div class="x_controls">
|
||||
<label for="image_autoconv_gif2mp4_Y" class="x_inline">
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_Y" value="Y" checked="checked"|cond="$config->image_autoconv['gif2mp4'] === true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_Y" value="Y" checked="checked"|cond="$config->image_autoconv['gif2mp4'] === true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label for="image_autoconv_gif2mp4_N" class="x_inline">
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_N" value="N" checked="checked"|cond="$config->image_autoconv['gif2mp4'] !== true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="image_autoconv_gif2mp4" id="image_autoconv_gif2mp4_N" value="N" checked="checked"|cond="$config->image_autoconv['gif2mp4'] !== true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_image_autoconv_gif2mp4}</p>
|
||||
<p class="x_text-info" cond="!$is_ffmpeg">{$lang->msg_cannot_use_ffmpeg}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -115,21 +116,23 @@
|
|||
<label class="x_control-label">{$lang->video_thumbnail}</label>
|
||||
<div class="x_controls">
|
||||
<label for="video_thumbnail_Y" class="x_inline">
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_Y" value="Y" checked="checked"|cond="$config->video_thumbnail === true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_Y" value="Y" checked="checked"|cond="$config->video_thumbnail === true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_yes}
|
||||
</label>
|
||||
<label for="video_thumbnail_N" class="x_inline">
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_N" value="N" checked="checked"|cond="$config->video_thumbnail !== true" disabled="disabled"|cond="!function_exists('exec')" />
|
||||
<input type="radio" name="video_thumbnail" id="video_thumbnail_N" value="N" checked="checked"|cond="$config->video_thumbnail !== true" disabled="disabled"|cond="!$is_ffmpeg" />
|
||||
{$lang->cmd_no}
|
||||
</label>
|
||||
<p class="x_help-block">{$lang->about_video_thumbnail}</p>
|
||||
<p class="x_text-info" cond="!$is_ffmpeg">{$lang->msg_cannot_use_ffmpeg}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->video_mp4_gif_time}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" min="0" name="video_mp4_gif_time" value="{$config->video_mp4_gif_time}" style="min-width:80px" disabled="disabled"|cond="!function_exists('exec')" /> {$lang->unit_sec}
|
||||
<input type="number" min="0" name="video_mp4_gif_time" value="{$config->video_mp4_gif_time}" style="min-width:80px" disabled="disabled"|cond="!$is_ffmpeg" /> {$lang->unit_sec}
|
||||
<p class="x_help-block">{$lang->about_video_mp4_gif_time}</p>
|
||||
<p class="x_text-info" cond="!$is_ffmpeg">{$lang->msg_cannot_use_ffmpeg}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue