/** * 获取图像信息 * @param string $target 文件路径 * @return mixed */ function getImageInfo($target) { $ext = es_imagecls::fileExt($target); $is_image = es_imagecls::isImageExt($ext); if (!$is_image) { return false; } elseif (!is_readable($target)) { return false; } elseif ($image_info = @getimagesize($target)) { list($width, $height, $type) = !empty($image_info) ? $image_info : array('', '', ''); $size = $width * $height; if ($is_image && !in_array($type, array(1, 2, 3, 6, 13))) { return false; } $image_info['type'] = strtolower(substr(image_type_to_extension($image_info[2]), 1)); return $image_info; } else { return false; } }