def _get_exif_orientation(exif):
 exif_dict = piexif.load(exif)
 return exif_dict['0th'].get(piexif.ImageIFD.Orientation)

def _get_exif_orientation ( exif ) : exif_dict = piexif . load ( exif ) return exif_dict [ '0th' ] . get ( piexif . ImageIFD . Orientation )
return the orientation value for the given image object .