Image information (PHP)
by spyka (http://www.spyka.net)
Use the code below to display the dimensions, mime type and filesize of an image. This can be helpful when wanting to resize an image.
Code:
<?
$info=getimagesize("image.jpg");
// display details
echo "Image width: ".$info[0]."<br />";
echo "Image height: ".$info[1]."<br />";
echo "Image type: ".$info[mime]."<br />";
echo "Image size: ".$info[bits]."<br />";
?>