修复webp转换其他格式失败

This commit is contained in:
icret
2022-03-10 23:40:15 +08:00
parent 8b05affa30
commit 736588e98d
6 changed files with 24 additions and 19 deletions

View File

@@ -39,7 +39,12 @@ if ($handle->uploaded) {
// 最小高度
$handle->image_min_height = $config['minHeight'];
// 转换图片为指定格式
$handle->image_convert = $config['imgConvert'];
if (isset($config['imgConvert'])) {
// 只转换非webp格式和非动态图片
if ($handle->file_src_name_ext !== 'webp' && !isAnimatedGif($handle->file_src_pathname)) {
$handle->image_convert = $config['imgConvert'];
}
}
// 存储图片路径:images/201807/
$handle->process('../' . config_path());