Why YSK: There’s been many image posts to the fediverse that have incorrect rotations and this info should help you to prevent that situation for your own posts.

Your phone’s camera app will add some metadata to the pictures you take called Exif data.
Most apps will simply add metadata that asks for the image to be rotated rather than actually rotating the image so that the picture-taking experience seems smoother/faster. This metadata is usually striped out by most websites when you submit them which leaves the image in the original rotation rather than the one you might have expected.

Why is this metadata removed by websites? The GPS location of where you took the picture can be included in that data as well as other sensitive info such as the date/time and the unique ID for your device. This data is often removed from the images to prevent leaking that info but not all sites will do this so it’s good to make a habit of purging that info yourself before putting them online!

Use an image editor app that will show the real rotation and/or strip out the Exif metadata. There’s a helpful article on XDA for both android and ios that shows how to disable the location data as well as some apps to remove exif data: https://www.xda-developers.com/how-to-view-remove-exif-data-android-ios/