1.提交缺失的东西

This commit is contained in:
2025-05-13 11:36:49 +08:00
parent 35ae7ffc85
commit 6a5ac8beff
4 changed files with 506 additions and 0 deletions

View File

@ -62,7 +62,22 @@ function compare_php(string $version) : bool
return version_compare(PHP_VERSION, $version) >= 0 ? true : false;
}
function check_is_image($image) : bool
{
try {
if (function_exists('exif_imagetype')) {
$ImageType = exif_imagetype($image);
} else {
$info = getimagesize($image);
$ImageType = $info ? $info[2] : false;
}
} catch (\Exception $e) {
return false;
}
return in_array($ImageType, [1, 2, 3, 6]);
}
/**
* @notes 检查文件是否可写
* @param string $dir