Determining dimensions of an uploaded photo using PHP
I was wondering if it is possible to get an uploaded images dimensions using PHP, so that I could set it as a potrait/landscape image, which would help in making 开发者_StackOverflowthumbnails that don't look awful. Anyone know a way to do this?
Thanks!
Sure:
list($width, $height) = getimagesize($image_path);
Sure, use getimagesize() on your uploaded file.
Use: getimagesize() function
精彩评论