harmmy

Sideways photos, rotation and the EXIF orientation tag

Why a photo looks upright on your phone and sideways in a form, the difference between rotating pixels and rewriting a tag, and when mirroring ruins a picture.

2026-12-01

The camera rarely stores the pixels upright

Phone cameras are built around a sensor that does not move. If you hold the phone on its side, the sensor still records a wide frame, and the operating system writes an EXIF Orientation value such as 6 or 8 to remember how the device was held. Gallery apps read that tag and display the photo upright; the underlying pixels were never rotated.

This is why the same file can look correct in Photos and sideways in an upload form, a CMS or an older desktop program. The viewer that ignores the tag shows the raw sensor orientation. Nothing is broken and nothing is duplicated — two pieces of software simply disagree about whether to honour three bytes of metadata.

Rotate the pixels or rewrite the tag?

Rewriting the Orientation tag is lossless and instant: the image data is untouched, only the instruction changes. It works when every program downstream honours EXIF. It fails when the next tool strips metadata, which many web pipelines do for privacy or size, and the photo snaps back to sideways.

Rotating the pixels bakes the orientation into the image, so it survives any metadata stripping and any viewer. For a photo that will be uploaded, printed or sent to a client, baking is the safer choice. Keep the original file; repeated lossy re-encoding slowly softens detail, so do the rotation once from the original rather than from an already compressed copy.

90 degrees is not the same as 3 degrees

A 90 or 180 degree rotation maps pixels onto exact pixel positions, so nothing is interpolated and sharp text stays sharp. An arbitrary angle such as 3 degrees for a crooked scan cannot do that: every destination pixel falls between source pixels, the editor has to interpolate, and the image gets slightly softer. It also leaves empty triangles in the corners unless the canvas is enlarged or the result is cropped.

For scanned documents, a small correction is often worth the softness because a tilted contract looks unprofessional. For photographs, prefer straightening by cropping rather than rotating a fraction of a degree; the eye notices a tilted horizon far more than a slightly tighter frame.

Flipping is not rotating

A horizontal flip mirrors the image left to right, which is useful for correcting a selfie or matching a design, and disastrous for anything with text, logos, numbers or a recognisable face asymmetry. A vertical flip mirrors top to bottom and turns a portrait into something that reads as upside down without being rotated.

If the goal is to fix a mirrored webcam or a scanned transparency, flip once and check every piece of text in the result. If the goal is to make a photo face the other way for a layout, mirroring a person is usually obvious and often unflattering; cropping and repositioning is the safer design move.

A five-second check before exporting

Look for a clock, a label, a street sign or any text in the frame. Text is the fastest way to catch a mirror that a face will hide. Then check the horizon and the subject's eyes: a portrait rotated 90 degrees is obvious, but a landscape rotated 180 degrees can look almost plausible until you notice the sky at the bottom.

Finally, open the exported file in a different program from the one you used to edit it. If it still looks right after leaving the editor, the orientation is baked in rather than merely displayed. For screenshots and documents, export PNG; for photographs, JPEG is fine and much smaller.

Related tools

Sideways photos, rotation and the EXIF orientation tag | harmmy