think\File::getImageType PHP Method

getImageType() protected method

判断图像类型
protected getImageType ( $image )
    protected function getImageType($image)
    {
        if (function_exists('exif_imagetype')) {
            return exif_imagetype($image);
        } else {
            $info = getimagesize($image);
            return $info[2];
        }
    }