Under the hood
Why photos come out sideways
Phones store a note in the file saying which way up the camera was held. Some apps ignore that note, so the picture looks sideways.
This tool applies that note first, then your rotation, and saves the pixels the right way up so every app shows the same thing.