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
I've always done this:
list($width, $height) = getimagesize('image.jpg'); if ($width > $height) { // Landscape } else { // Portrait or Square }