function getImageInfo($img) //$img为图像文件绝对路径
{
$img_info = getimagesize($img);
switch ($img_info[2]) {
case 1:
$imgtype = "GIF";
break;
case 2:
$imgtype = "JPG";
break;
case 3:
$imgtype = "PNG";
break;
}
$img_type = $imgtype . "图像";
$img_size = ceil(filesize($img) / 1000) . "k"; //获取文件大小
$new_img_info = array(
"width" => $img_info[0],
"height" => $img_info[1],
"type" => $img_type,
"size" => $img_size
);
print " width";
print $img_info[0];
print " height";
print $img_info[1];
print " format";
print $img_type;
print " size";
print $img_size;
print $new_img_info;
}
$img = "/www/htdocs/images/jf.gif";
getImageInfo($img);
?>
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。