From 124ea5c1b135f71bcd3434ab32c23e851690fd1c Mon Sep 17 00:00:00 2001 From: icret Date: Wed, 5 Jan 2022 03:00:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=8F=E8=94=BD=E7=94=9F=E6=88=90=E7=BC=A9?= =?UTF-8?q?=E7=95=A5=E5=9B=BE=E9=94=99=E8=AF=AF=E7=9A=84=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 ++++++++--------- admin/admin.inc.php | 13 +++++++------ application/check.php | 2 +- application/function.php | 7 ++++++- application/header.php | 2 +- config/config.php | 6 +++--- index.php | 20 ++++++++++---------- 7 files changed, 36 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 07bc96a..cbadd9a 100755 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ Deny from all - 增加以源文件名称命名 - 增加缩略图两种生成方式和开关 - 修复开启前端压缩导致的上传图片异常 +- 屏蔽因缺少PHP扩展而不能生成缩略图的格式 * 2021-12-25 v2.4.4 @@ -268,6 +269,8 @@ RewriteRule config/(.*).(php)$ – [F]
与1.6.4版本差别 +##### 不建议再使用 [EasyImage 1.6.4版本](https://github.com/icret/easyImages) + - 在继承上个版本([1.6.4](https://github.com/icret/easyImages "1.6.4"))的基础上进行了全新优化 - 修复上传经常失败的问题 - 删除一些不常用但会增加功耗的过程 (删除的在下边会有标记) @@ -284,17 +287,13 @@ RewriteRule config/(.*).(php)$ – [F]
- -不建议再使用 [EasyImage 1.6.4版本](https://github.com/icret/easyImages) - -
- #### 兼容性 -PHP推荐使用PHP7.0及以上版本,需要PHP支持Fileinfo、iconv、zip、mbstring、openssl 扩展,如果缺失会导致无法访问管理面板以及上传/删除图片。 -文件上传视图提供文件列表管理和文件批量上传功能,允许拖拽(需要 HTML5 支持)来添加上传文件,支持上传大图片,优先使用 HTML5,旧的浏览器自动使用Flash和Silverlight的方式兼容。 +- `PHP>5.6`,推荐使用`PHP7.0`及以上版本,需要PHP支持`Fileinfo,iconv,zip,mbstring,openssl`扩展,如果缺失会导致无法上传/删除图片 +- 文件上传视图提供文件列表管理和文件批量上传功能,允许拖拽(需要`HTML5`支持)来添加上传文件,支持上传大图片,优先使用`HTML5`旧得浏览器自动使用`Flash和Silverlight`的方式兼容 +
- 感谢: [verot](https://github.com/verot/class.upload.php "verot" )提供非常好用的class.upload.php上传类 - - 感谢: [ZUI](https://github.com/easysoft/zui "ZUI" ) 提供css框架 - - 本源码遵循 GNU Public License \ No newline at end of file + - 感谢: [ZUI](https://github.com/easysoft/zui "ZUI" ) 提供前端框架 + - [使用 GPL-3.0 开源许可协议](https://github.com/icret/EasyImages2.0/blob/master/LICENSE) \ No newline at end of file diff --git a/admin/admin.inc.php b/admin/admin.inc.php index d2eca08..797d9bb 100755 --- a/admin/admin.inc.php +++ b/admin/admin.inc.php @@ -196,10 +196,11 @@ if (isset($_POST['radio'])) {
@@ -307,7 +308,7 @@ if (isset($_POST['radio'])) {
title=" 轻微有损压缩图片, 此压缩有可能使图片变大!特别是小图片 也有一定概率改变图片方向"> - +
@@ -321,7 +322,7 @@ if (isset($_POST['radio'])) { id="thumbnail1">
- id="thumbnail2"> + id="thumbnail2">
diff --git a/application/check.php b/application/check.php index d8b00c8..8d582a1 100755 --- a/application/check.php +++ b/application/check.php @@ -56,7 +56,7 @@ if (!is_file(APP_ROOT . '/config/EasyIamge.lock')) { echo 'upload_max_filesize - PHP上传最大值:' . ini_get('upload_max_filesize'); echo '
post_max_size - POST上传最大值:' . ini_get('post_max_size') . '
'; // 扩展检测 - $expand = array('fileinfo', 'gd', 'openssl',); + $expand = array('fileinfo', 'gd', 'openssl','imagick'); foreach ($expand as $val) { if (extension_loaded($val)) { echo ' diff --git a/application/function.php b/application/function.php index 00f542d..80eee4d 100755 --- a/application/function.php +++ b/application/function.php @@ -239,7 +239,7 @@ function getFile($dir) //去掉"“.”、“..”以及带“.xxx”后缀的文件 if ($file != "." && $file != ".." && strpos($file, ".")) { $fileArray[$i] = $file; - if ($i == 100) { + if ($i == 1000) { break; } $i++; @@ -661,6 +661,11 @@ function creat_thumbnail_by_list($imgUrl) return $config['imgurl'] . $config['path'] . 'thumbnails/' . $imgName; } else { + // PHP老他妈缺图像扩展支持,不是缺webp就是缺ico,总不能都他妈装上吧,直接把这些二货扩展名忽略 + if (!in_array(pathinfo(basename($pathName), PATHINFO_EXTENSION), array('png', 'gif', 'jpeg', 'jpg'))) { + return $imgUrl; + } + // 不存在则创建缓存文件并输出文件链接 require_once __DIR__ . '/class.thumb.php'; diff --git a/application/header.php b/application/header.php index 3ede8f9..b9be81d 100755 --- a/application/header.php +++ b/application/header.php @@ -53,7 +53,7 @@ require_once APP_ROOT . '/application/total_files.php';
  • - 广场 + 广场 diff --git a/config/config.php b/config/config.php index cbbe0ff..d928043 100755 --- a/config/config.php +++ b/config/config.php @@ -21,9 +21,9 @@ $config=Array 'textSize'=>16, 'textFont'=>'/public/static/hkxzy.ttf', 'waterImg'=>'/public/images/watermark.png', - 'extensions'=>'bmp,jpg,png,tif,gif,pcx,tga,svg,webp,jpeg,tga,svg,ico', + 'extensions'=>'gif,jpeg,png,tif,bmp,tif,svg,webp,jpg,tga,svg,ico', 'compress'=>0, - 'thumbnail'=>0, + 'thumbnail'=>2, 'imgConvert'=>'', 'maxWidth'=>10240, 'maxHeight'=>10240, @@ -71,6 +71,6 @@ $config=Array 'form'=>'', 'TinyImag_key'=>'', 'moderatecontent_key'=>'', - 'footer'=>'请勿上传违反中国政策的图片 + 'footer'=>'请勿上传违反中国政策的图片
    ' ); \ No newline at end of file diff --git a/index.php b/index.php index b6a889a..c7731fc 100755 --- a/index.php +++ b/index.php @@ -30,45 +30,45 @@ mustLogin();
    - +
    - +
    - +
    - +
    - +