Phones save photos as the sensor saw them, with a note saying which way to turn them, and most desktop browsers ignore that note. Rotate the pixels before uploading, or have the site turn each photo as it arrives.

Upright on the phone, sideways online

A crew finishes a job, takes a few photos on a phone and sends them to the office for the website. On the phone, every one of them looks right.

A week after they go up, a customer mentions that half the gallery is lying on its side. On the office computer some look fine and some do not, and no one has touched them.

Nothing is wrong with the photos. The phone and the browser simply disagree about which way is up.

What the phone saves

A phone's camera sensor is fixed in one position. Whichever way the phone is held, the picture is recorded as the sensor saw it.

Instead of turning the picture, the phone adds a note to the hidden details stored inside the file, known as EXIF data, saying which way to rotate it for display.

Hold a phone upright, as most people do for a doorway or a window frame, and the photo depends entirely on that note.

The phone's own gallery reads the note and shows the photo upright, which is why the person who took it sees nothing wrong.

Who reads the note

Whether a photo appears upright depends on what is showing it:

So the office, a customer at home and a visitor on a tablet can each see the same file differently. The photo has not changed; only the software reading it has.

Turning the pixels before upload

The dependable fix is to rotate the picture itself, so the pixels are stored upright and no note is needed.

Most photo programs can do it: open the photo, turn it until it is upright, and save a copy. Then open the copy in a web browser, not in the program that turned it.

Some programs turn the pixels but leave the old note in place. Anything that still obeys the note then turns the photo a second time, so check the saved copy on a phone too.

Letting the site do the turning

When photos arrive often and from several people, the website can take over. As each photo is uploaded, the site reads the note, rotates the pixels and saves an upright copy.

On WordPress and most other common systems, a developer can add this without much work, and it removes a step that busy crews and office staff forget.

The same code can be run once over the photos already in the gallery, fixing every one that carries a note.

Other details hidden in the file

The hidden details that hold the rotation note can also hold the date, the phone model and, if location is switched on, the exact place where the photo was taken.

For a contractor's job photos, that place is usually a customer's home. Some programs keep these details when saving a copy and some drop them, so find out which yours does.

Removing them as photos are prepared for the website settles the question for every image.

A worked example

A caulking contractor in Nanaimo seals windows, doors and joints on houses and small apartment buildings. Its website has a gallery of finished work, added by the office manager from photos the crews send in.

A property manager mentioned that the gallery looked careless, with several photos on their sides. The office manager had checked each one in the photo program on her computer, which read the note and showed them upright.

She had never looked at the gallery itself in a browser. A developer opened the files and found the rotation note in every sideways photo, along with location details pointing to customers' homes.

The site now rotates each photo as it arrives and saves it without the hidden details. The existing gallery was run through the same process once.

With the pixels themselves upright, every browser shows the photos the same way, whatever it does with notes. And a gallery photo no longer records where a customer lives.

Photos that start out wrong

A photo taken pointing straight down, at a floor, a sill or a counter, can get the wrong note, because the phone cannot tell which edge is up.

These look wrong everywhere, even on the phone, and need turning by hand. Ask whoever sends photos to glance at each one first, and to send the originals by email rather than copies shrunk by a messaging app.

Checking the gallery

The reliable test is to view the gallery the way visitors do: in two or three desktop browsers, then on a phone and a tablet.

Avoid judging photos in a photo program on your own computer. It may read the note and show an upright picture that visitors never see.

Do it after each batch of uploads. A gallery that looked right last month can go wrong with the next photo.

The counter-case

A site that adds a few photos a year, all taken by one careful person, may never show the problem. Turning each one by hand before upload takes a minute.

Some photos need no turning at all, if the phone was held in the sensor's own position when they were taken.

But a gallery fed by several people from several phones will eventually get a sideways photo, and an upload step that fixes every one is less trouble than finding them through complaints.

Upright on every screen

  1. Open the gallery in two browsers on a computer.
  2. Look again on a phone and a tablet.
  3. List the photos that lie on their side.
  4. Rotate the pixels and save upright copies.
  5. Strip location details from job photos.
  6. Ask a developer to turn uploads automatically.
  7. Brief the crews on sending originals.

Step six is the lasting fix. Turning photos by hand depends on someone remembering every time; an upload that turns the pixels itself treats every photo the same, whoever took it.

Whether gallery pages were among the pages that brought enquiries last year is one of the questions worked through in what last year's analytics can tell you in January.


Frequently asked questions

Why do photos look right on the phone but sideways on the website?

The phone stores the picture as its sensor saw it, with a note saying how to turn it. The phone obeys the note; most desktop browsers ignore it.

Is the photo itself damaged?

No. The pixels are intact, just stored on their side. Rotating them and saving an upright copy gives a photo that every browser shows the right way up.

Why does the office see something different from customers?

Programs treat the note differently. A photo program on the office computer may obey it while a visitor's browser ignores it, so the same file looks different.

Can the website rotate photos automatically?

Yes. A developer can have the site read the note on each upload, rotate the pixels and save an upright copy, then fix the existing gallery in one pass.

What else is hidden inside a phone photo?

Usually the date, the phone model and, if location is on, where it was taken. For job photos that can mean a customer's address, so remove it before publishing.

Why are some photos wrong even on the phone?

Photos taken pointing straight down, at a floor or a counter, can get the wrong note because the phone cannot tell which edge is up. Turn those by hand.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Gallery photos lying on their side?

Send us the gallery's address, and we will check the files and set the site to turn new uploads upright.

Start a Conversation