Orientation detection or correction