Modern phones have an accelerometer that measures the direction gravity is pulling, so the phone knows which way is down.
The Jpeg format your phone saves pictures in has metadata telling the viewer software which orientation the picture was taken in, and the viewer software will rotate the image to match.
Latest Answers