You can try the following code. It might work if your images contain the EXIF orientation value.
It is easy enough to test the code below and see if the property ID exist.
Not sure this will solve your problem, but it is worth a try.
Image img = Image.FromFile("some file path");
if (img.PropertyIdList.Contains(0x0112))
{
PropertyItem propOrientation = _image.GetPropertyItem(0x0112);
short orientation = BitConverter.ToInt16(propOrientation.Value, 0);
if (orientation == 6)
{
img.RotateFlip(RotateFlipType.Rotate90FlipNone);
}
else if (orientation == 8)
{
img.RotateFlip(RotateFlipType.Rotate270FlipNone);
}
else
{
}
}
Orientation Values
1 = Horizontal
6 = Vertical, rotated 90 degrees
8 = Vertical, rotated 270 degrees
The above values works at least on pictures taken with my Canon DSLR camera.
I have never tried to take a picture upside down, though.