How can I get the image orientation (landscape or portrait) of an image (JPEG or PNG) in PHP?
I created a php site where users can upload pictures. Before I scale them
list($width, $height) = getimagesize("path/to/your/image.jpg"); if( $width > $height) $orientation = "landscape"; else $orientation = "portrait";