if you're using imagemagick, you can use -auto-orient to have it burn in the orientation set in EXIF