Copy code The code is as follows:
function getimageinfo(img) { //img is an image file absolute Path
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."image";
img_size = ceil(filesize(img)/1000)."k"; //Get the file size
new_img_info = array (
"width"=>img_info[0],
"height"=> ;img_info[1],
"type"=>img_type
"size"=>img_size
}
return new_img_info;
}
?>
http://www.bkjia.com/PHPjc/319761.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319761.htmlTechArticleCopy the code as follows: ?php function getimageinfo(img) { //img is the absolute path of the image file img_info = getimagesize(img); switch (img_info[2]) { case 1: imgtype = "gif"; break; c...