Photo comes out sideways
The shot looks upright in the gallery and lands on its side after converting. The cause is not your file: in JPEG and HEIC the orientation lives in a separate EXIF tag rather than in the pixels. The browser applies that tag in an <img>; most decoders do not.
How to do it
- Pick the shot that keeps coming out sideways
- Nothing to switch on — the orientation tag is read and applied for you
- Take the result: the rotation is baked into the pixels now
Frequently asked questions
- Why does this happen at all?
- The phone camera shoots with the sensor in one position and does not rotate the pixels — it simply writes a “rotate 90°” tag. Software that reads the tag shows it upright; software that does not shows it sideways. We checked: our own decoder returned 8×4 with the tag and without it alike.
- When exactly is the rotation applied?
- First, before anything else. That matters: masking, cropping and padding anchors all work in coordinates, and rotating after them would put “top left” somewhere other than where you saw it.
- What if the tag is corrupt?
- Then it is simply ignored. Broken EXIF turns up more often than one would like, and it is no reason to refuse to process a photograph.