use libexif for getting the EXIF orientation tag, it is so much faster than identify...