From 736588e98dcd117e9118af3d12245925b9d5fe15 Mon Sep 17 00:00:00 2001 From: icret Date: Thu, 10 Mar 2022 23:40:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwebp=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E6=A0=BC=E5=BC=8F=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 ++++++++------ api/index.php | 7 ++++++- application/process.php | 2 +- application/upload.php | 14 ++++++-------- config/config.php | 4 ++-- index.php | 2 +- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index acb2b3a..0e47cd0 100755 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ > [演示](https://png.cm/)   -[Chrome 拓展](https://github.com/icret/EasyImage-Browser-Extension)   +[Chrome/Edge 插件](https://github.com/icret/EasyImage-Browser-Extension)   [使用手册](https://www.kancloud.cn/easyimage/easyimage/)   [问题反馈](https://support.qq.com/products/367633)   [QQ群](https://shang.qq.com/wpa/qunwpa?idkey=3feb4e8be8f1839f71e53bf2e876de36afc6889b2630c33c877d8df5a5583a6f) @@ -102,10 +102,11 @@ $HTTP["url"] =~ "^/(i|public)/" { ## 更新日志 -
点击查看2.0版更新日志 +
点击查看2.0版更新日志 -* 2022-3-7 v2.5.6 dev +* 2022-3-10 v2.5.6 dev - 修复加密删除后不能正确提示 +- 修复webp转换其他格式失败 * 2022-3-4 v2.5.5 - 增加设置页面检测是否开启登录上传 @@ -402,7 +403,7 @@ RewriteRule config/(.*).(php)$ – [F] - ~~支持删除自定义删除图片(仅管理员)~~
-
与1.6.4版本差别 +
与1.6.4版本差别 ##### 不建议再使用 [EasyImage 1.6.4版本](https://github.com/icret/easyImages) @@ -449,5 +450,6 @@ RewriteRule config/(.*).(php)$ – [F] - Copyright © 2018 EasyImage dev By [Icret](https://github.com/icret) * have fun! - - [![Stargazers over time](https://starchart.cc/icret/EasyImages2.0.svg)](https://github.com/icret/EasyImages2.0/stargazers) + +![项目状态](https://repobeats.axiom.co/api/embed/0922803f14091f0686de26fee5196b9984b106a4.svg "Repobeats analytics image") +[![Stargazers over time](https://starchart.cc/icret/EasyImages2.0.svg)](https://github.com/icret/EasyImages2.0/stargazers) diff --git a/api/index.php b/api/index.php index 99c4a3f..cdeb5de 100755 --- a/api/index.php +++ b/api/index.php @@ -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()); diff --git a/application/process.php b/application/process.php index aa6aee9..88fc1bc 100755 --- a/application/process.php +++ b/application/process.php @@ -127,4 +127,4 @@ function write_log($filePath, $sourceName, $absolutePath, $fileSize, $from = "We $log = array_replace($logs, $log); cache_write($logFileName, $log, 'logs'); */ -} \ No newline at end of file +} diff --git a/application/upload.php b/application/upload.php index 0268d23..94c4509 100755 --- a/application/upload.php +++ b/application/upload.php @@ -38,7 +38,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']; + } + } /* 等比例缩减图片 放到前端了 if ($config['imgRatio']) { @@ -51,13 +56,6 @@ if ($handle->uploaded) { // 存储图片路径:images/201807/ $handle->process(APP_ROOT . config_path()); - /* - // 创建缩略图 开启后会个别返回文件失败,暂时没找到替代方案,如果启用此项目,需要将list.php中的get_online_thumbnail改成return_thumbnail_images函数 - if ($config['thumbnail']) { - @creat_thumbnail_images($handle->file_dst_name); - } - */ - // 图片完整相对路径:/i/2021/05/03/k88e7p.jpg if ($handle->processed) { header('Content-type:text/json'); diff --git a/config/config.php b/config/config.php index 323edf9..486b8be 100755 --- a/config/config.php +++ b/config/config.php @@ -39,7 +39,7 @@ $config=Array 'imgRatio_quality'=>80, 'imgRatio_crop'=>0, 'imgRatio_preserve_headers'=>1, - 'static_cdn'=>1, + 'static_cdn'=>0, 'theme'=>'default', 'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0@2.5.5', 'TinyPng_key'=>'', @@ -99,7 +99,7 @@ var _hmt = _hmt || []; 'image_recycl'=>1, 'delDir'=>'thumbnails/', 'version'=>'2.5.5', - 'update'=>'2022-03-07 12:32:21', + 'update'=>'2022-03-10 23:30:29', 'terms'=>'
diff --git a/index.php b/index.php index 839a4dc..29364d5 100755 --- a/index.php +++ b/index.php @@ -103,7 +103,7 @@ mustLogin(); // 自动上传 autoUpload: false, // 文件上传提交地址 - url: '/application/upload.php', + url: './application/upload.php', // 最大支持的上传文件 max_file_size: , // 分片上传 0为不分片 分片容易使图片上传失败