Test code for determining the orientation of an image