Landscape or portrait

Hey there.
I am trying to determine the orientation of a picture.
I have the image source, but what I’d like, is being able to know, given the source - the orientation of the image and hence use the proper orientation on the display.
Any ideas?
Thanks.