Well, I've been having some mysterious problems finding out image orientations as they simply seem to disappear.
Image orientation is contained in EXIF meta data and can be gotten through the Image.PropertyItems property of an Image.
However, when dealing with an image, Windows places a lock on the file, making things rather inconvenient. As such, you need to clone or copy the image then dispose of the Image something like this:
img.Dispose();
img = null;
For slower computers or limited memory you'd also want to do garbage collection with GC.Collect().
However, once you do that, the image orientation EXIF information is no longer available. It just disappears.
So, to get the orientation you must leave the file locked, get the information like this:
PropertyItem propItem = image.GetPropertyItem(274);
ushort orientation = propItem.Value;&l ...