屏蔽生成缩略图错误的图片格式

This commit is contained in:
icret
2022-01-05 03:00:36 +08:00
parent 4a43eb7d1d
commit 124ea5c1b1
7 changed files with 36 additions and 31 deletions

View File

@@ -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';