Get image height and width PHP

怎甘沉沦 提交于 2019-11-30 06:55:56

Should be

list($width, $height, $type, $attr) = getimagesize($_FILES["Artwork"]['tmp_name']);

See http://www.php.net/manual/en/features.file-upload.post-method.php

<?php

$imagedetails = getimagesize($_FILES['Artwork']['tmp_name']);
$width = $imagedetails[0];
$height = $imagedetails[1];

?>
<?php
/*$size = getimagesize("http://heartbeatperformance.com.p9.hostingprod.com/customerphotos/photoes/51HDE3cnl2L.jpg");

list($width, $height) = $size;
echo "width: $width<br />height: $height";*/



$testing = "http://heartbeatperformance.com.p9.hostingprod.com/customerphotos/img/logo.png";
//echo $testing;
list($width, $height, $type, $attr) = getimagesize($testing);
echo "Image width " . $width;
echo "Image height " . $height;



?>

$DOCS_NAME = $_FILES['DOCS']['name'];
$DOCS_SIZE = getimagesize($_FILES['DOCS']['tmp_name']);
$DOCS      = file_get_contents ($_FILES['DOCS']['tmp_name']);
$FILE_SIZE = $_FILES["DOCS"]["size"];
$FILE_TYPE = $_FILES["DOCS"]["type"];

echo 'Width     = '.$DOCS_SIZE[0]. "<br />";
echo 'Height    = '.$DOCS_SIZE[1]. "<br />";;  
echo '2         = '.$DOCS_SIZE[2]. "<br />";;  
echo '3         = '.$DOCS_SIZE[3]. "<br />";;  
echo 'bits      = '.$DOCS_SIZE['bits']. "<br />";;
echo 'channels  = '.$DOCS_SIZE['channels']. "<br />";;
echo 'mime      = '.$DOCS_SIZE['mime']. "<br />";
echo 'type      = '.$_FILES["DOCS"]["type"]. "<br />";
echo 'size      = '.$_FILES["DOCS"]["size"]. "<br />"; 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!