$data = getimagesize($filename); $width = $data[0]; $height = $data[1];