Currently if a user POST/uploads a photo to my PHP script I start out with some code like this
getimagesize($_FILES[\'picture1\'][\'tmp_name\']);
If you've already got an image resource, you'd get the size using the imagesx and imagesy functions.