1.提交缺失的东西
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user