Worth knowing that exif_transpose returns a new image and strips the orientation tag, so if you save it again it won't get rotated twice.