Manatee

A photo that turns sideways after you send or convert it

A photo that looks upright on your Mac and arrives sideways somewhere else was never stored upright. Phones and cameras save the pixels in the sensor’s own layout and add a metadata tag, Orientation, that tells viewers how to turn the picture for display. Your Mac reads the tag; some websites, devices, converters and privacy tools ignore it or remove it, and the photo falls back to how it was really stored. The lasting fix is a copy whose pixels are upright, checked before you send it.

How a photo can be sideways and upright at once

Hold an iPhone upright and take a picture. The sensor still captures a landscape frame, for example 4,032 pixels wide and 3,024 tall, and the camera writes Orientation 6 into the file, which means “turn this a quarter turn clockwise before showing it.” Preview, Photos, Finder and current web browsers follow that instruction, so you see a portrait photo. The file still holds a landscape one.

The values you will meet:

  • 1: stored upright, show it as it is.
  • 3: stored upside down, turn it half a turn.
  • 6: turn it a quarter turn clockwise. A phone held upright usually writes this.
  • 8: turn it a quarter turn counterclockwise. A phone held upside down in portrait writes this.

Anything that ignores the tag shows the raw layout: a portrait shot lying on its side, or a landscape shot upside down.

Where the tag gets ignored or lost

  • Upload systems that process images. Many sites resize uploads and strip metadata on the way in, for privacy and to save space. If that processing drops the tag without turning the pixels first, the stored copy is sideways, even though your browser showed it correctly in the preview before you clicked Upload.
  • Older or simpler software and hardware. Some print kiosks, digital photo frames, TVs and older email or office software ignore the tag entirely.
  • Converters. A conversion writes a new file. Whether the tag is carried across, applied to the pixels or dropped depends on the tool, which is how a HEIC that looked fine becomes a sideways JPEG.
  • Metadata cleaning. Stripping EXIF to remove the location and camera details can take Orientation with it. The guide to stripping EXIF data covers this from the privacy side.
  • Rotation that turns the pixels but keeps the tag. The opposite mistake: the pixels are turned, the old tag stays, and viewers that honor it turn the picture a second time. In our testing on macOS 15, the built-in sips -r 90 command did exactly this: the pixels were rotated and the file still said Orientation 6.

Sending through Messages, AirDrop or Mail is mostly a question of which metadata survives the trip; does AirDrop, iMessage or email strip photo metadata goes through each one.

Check what the file really holds

Two quick ways to see whether a photo is stored sideways.

In Preview. Open the photo and choose Tools > Show Inspector (Command-I). Click the More Info tab and look for an Orientation entry, usually in the General list (it can also appear under TIFF). A 1, or no entry at all, means the pixels are upright. A 6, 8 or 3 means the viewer is being asked to turn them.

In Terminal. The sips command reports the stored size and ignores the tag:

sips -g pixelWidth -g pixelHeight ~/Desktop/IMG_2041.jpg

If a photo that looks portrait on screen comes back as pixelWidth 4032 and pixelHeight 3024, the pixels are lying on their side and only the tag is holding the picture up. Any tool that drops the tag will show it sideways.

Make the pixels upright

There are two situations, and they need different handling.

The photo is sideways on your Mac too. The tag itself is wrong, usually because the phone was pointing straight down at a document or a plate and could not tell which way was up. Open the photo in Preview and choose Tools > Rotate Left (Command-L) or Rotate Right (Command-R) until it is right, then save.

That fixes how it looks on your Mac, but check the result with one of the methods above. For formats that can carry the tag, such as JPEG and HEIC, Preview may record a rotation by rewriting the Orientation value rather than turning the pixels. That is lossless, and it also leaves the photo dependent on the tag. If the stored size still disagrees with what you see, treat it as the next case.

The photo looks right on your Mac but not elsewhere. The tag is correct and the destination ignores it. You need a copy that has been drawn upright, not just relabeled.

  • With Photos. Import the picture, select it and choose File > Export > Export 1 Photo, with JPEG as the kind. That export is rendered by Photos from the library version rather than copied from the original file. Note that importing adds the picture to your library, and to iCloud Photos if you use it. Check the exported file with sips before you rely on it.
  • With Terminal. sips alone is no help here: its conversions to JPEG, PNG, HEIC and TIFF carry the old tag across unchanged, and its rotate option keeps it too. Quick Look’s command-line tool can draw a copy with the turn applied:
qlmanage -t -s 4032 -o ~/Desktop ~/Desktop/IMG_2041.jpg

Set the number after -s to the photo’s longer side (the larger number sips reported); a smaller number gives a smaller picture. In our testing on macOS 15, with a JPEG and a HEIC from an iPhone, it wrote a PNG named after the original plus .png (here IMG_2041.jpg.png), at full resolution, with the pixels upright and no Orientation tag. qlmanage is a Quick Look debugging tool rather than a converter, so treat its output as raw material: a 16-bit PNG, about 45 MB for a 12-megapixel photo in that test, with the date taken, camera details and location gone. Make a JPEG from it with sips:

sips -s format jpeg ~/Desktop/IMG_2041.jpg.png --out ~/Desktop/IMG_2041-upright.jpg

Then run the sips -g pixelWidth -g pixelHeight check on the JPEG. A portrait photo should now report the smaller number as its width.

Once the pixels are upright and the tag says 1 or is gone, the problem cannot come back: there is nothing left for a viewer to turn.

Converting and cleaning without undoing it

Order matters. Make the pixels upright first, then convert or clean, then check.

Manatee handles the later steps on your Mac. Convert writes a JPEG, PNG, HEIC or TIFF copy, and Clean strips GPS location and camera EXIF. Both write a new file next to the original, which is never modified, and nothing is uploaded. Whether a particular output keeps an Orientation tag is something to check rather than assume, with Manatee or any other tool, so run the Inspector or sips check on the new file before you send it. If you fixed the pixels first, it will not matter either way.

A sensible routine for a photo going to a website or a form:

  1. Check the stored size with sips.
  2. If it disagrees with what you see, make an upright copy.
  3. Convert or clean that copy.
  4. Check the final file once more, then upload it.

Questions

Why does the photo look right in the upload preview but sideways after posting? The preview is drawn by your browser, which follows the tag. The posted version was made by the site’s servers, which may have discarded the tag while resizing. A copy with upright pixels does not depend on either.

Does rotating a JPEG again and again lose quality? Changing the tag loses nothing. Turning the pixels of a JPEG usually means encoding it again, which costs a little each time, so do it once from the best copy you have rather than repeatedly.

Why are only some of my photos affected? Only photos taken with the camera turned away from its sensor’s natural landscape position carry a tag other than 1: on a phone, that means portrait shots and landscape shots taken the other way round. Landscape shots taken the sensor’s way up are stored as they look, so they survive any tool. Screenshots and scans are usually stored upright already.