I don’t believe it’s set in Exif headers, so a.dotty.dot’s solution will work if it remains that in the ‘horizontal’ position, the image has a larger width than height.
The technical terms in art and photography are “portrait” for vertical mode and “landscape” for horizontal mode. The aspect ratio for a portrait will always be > 1, and the ratio for landscape will always be < 1. If the aspect ratio is exactly 1, you’re talking about a square as opposed to an oblong rectangle. Since you didn’t specify how you wished to handle that case, I arbitrarily lumped square images in with portraits.
Thank you both. I already knew about the aspect ratio so I guess I wasn’t clear enough with my question.
I’ll try again: A photographer take a portrait picture. He import the picture into his computer and, for some reason, he rotates it 90 degrees, so it is now landscape/horizontal orientated. He now uploads it to a website. Then I wonder, is there a way to determine that the picture really should be a portrait and not a landscape?
-Helge
Off Topic:
a.dotty.dot: Thanks for translating the portrait and landscape. I just used the “norwegian” words and hoped people would understand.