A hand with a wristwatch reaching up to straighten a dark-framed photograph on a pale wall, two more frames beside it.

Stored one way round, labeled another

Formats · · · 26 min read

Why a Rotated Photo Is Sideways Somewhere Else

The photograph is upright on the phone that took it. It is upright in the folder on the computer. You attach it to an email, or drop it into a form at a print shop, or put it on a web page, and it arrives lying on its side. Nothing was rotated in between. No setting was changed. And if you rotate it to fix the email, it is now wrong on the phone. The reason is that a great many photographs are not stored the way up they are shown, and whether you ever find that out depends entirely on which program opens them.

Already recognize your own library? You can try it on your photographs now.

Free Test Drive Buy Now

The picture that is only sideways somewhere

This one has a particular shape to it, and the shape is what makes it so hard to get to the bottom of. The photograph is not broken. It is correct in most places and wrong in one, and the one keeps changing.

A portrait photograph of somebody standing up looks right on the phone. It looks right in the folder on the computer, and right when you double-click it. Then it goes somewhere else — an email attachment, an upload box at a print shop, a web page, a slideshow on a television, a photo book layout — and in that one place it is lying on its side. Rotate it so the email looks right and you have broken the three places that were fine.

Nothing in any of those programs is malfunctioning. They are reading the same file and disagreeing about one small piece of information in it, and that piece of information is deliberately hidden from you. Microsoft’s own specification for it says, in as many words: “This property is not meant to be displayed in the UI.”

So this article is about that one piece of information: what it is, who writes it, how often, and what happens when programs disagree. And then the measurement, because the figures turn out to be the surprising part. We read the orientation of every photograph in one ordinary family library — 82,707 of them, going back to 2000 — and the result is not “some photographs have this problem”. It is that the library contains at least four different conventions at once, laid down by different phones in different years, and no single rule describes it.

A photograph stored one way and labeled another

A camera sensor is a rectangle bolted into the camera, and it has no idea which way up the camera is being held. It reads out its rows and columns the same way every time. If you turn the camera on its side, the sensor does not turn with the scene; it records the scene sideways and something afterwards has to say so.

There are two ways to say so, and the whole of this subject follows from which one a program picks.

Rewrite the pixels. Decode the photograph, move every pixel to its new position, and save the file out again, upright. The file is now unambiguous and will look right everywhere forever. The cost is that saving a JPEG again means compressing it again, and that cost is permanent.

Leave the pixels and write a note. Store the picture exactly as the sensor read it and add one small field saying how far to turn it before it is shown. The file is tiny to write, nothing is lost, and the photograph is correct in every program that reads the note — and sideways in every program that does not.

Microsoft documents that second approach and, unusually, explains the reasoning in the same breath. Its published description of the orientation property reads:

“The orientation of the photo when it was taken, as specified in the Exchangeable Image File (EXIF) information and in terms of rows and columns. This allows applications and the Shell to properly orient the image, instead of orienting the pixels and persisting the image in the requested display orientation, which can result in a loss of fidelity. This property is not meant to be displayed in the UI.”

Read that twice, because both halves matter. The note exists specifically so that nobody has to rewrite the pixels, and the reason given is loss of quality. That is a good reason, and the approach is the right one. The second sentence is the price: the field is explicitly not something you are meant to see, so when it goes wrong there is nothing on the screen to look at.

The field itself is numbered. Microsoft’s documentation gives its address on disk as /app1/ifd/{ushort=274} — the 274th entry in the block of information a camera writes into the front of a JPEG. It holds a single small number, and that number is the entire subject of this article.

Apple: the iPhone never stores a portrait photo upright

The most useful sentence anybody has published about this is in Apple’s developer documentation, and it is worth quoting at length because it describes the ordinary case rather than an edge case:

“For example, the pixel data for an image captured by an iOS device camera is encoded in the camera sensor’s native landscape orientation. When the user captures a photo while holding the device in portrait orientation, iOS writes an orientation value of CGImagePropertyOrientation.right in the resulting image file. Software displaying the image can then, after reading that value from the file’s metadata, apply a 90° clockwise rotation to the image data so that the image appears in the photographer’s intended orientation.”

That is the mechanism, stated by the company that built it. Hold an iPhone upright, take a picture of a person, and what lands in the file is a landscape photograph of a person lying down, plus a note. Every portrait photograph you have ever taken on one is like this. It is not a fault and there is nothing to fix; it is the design, and it is the better design for the reason Microsoft gave.

And it is checkable. Of the 4,149 photographs in this library that carry a rotate-me note, 4,025 have more pixels across than down — a landscape file holding a portrait picture. That is 97.0% of them, and it is Apple’s paragraph showing up in a folder listing.

Apple’s documentation then supplies, unprompted, the single best illustration of why this breaks in the real world. The same page explains that Apple itself numbers these eight orientations two different ways in two different parts of its own software:

“The CGImagePropertyOrientation type covers the same set of orientation names available in from the UIImage.Orientation type, but the underlying numeric values of each type do not match. (For example, the ‘left mirrored’ orientation has an underlying value of 5 in CGImagePropertyOrientation, but an underlying value of 7 in UIImage.Orientation.)”

Eight orientations, two numbering schemes, inside one company, documented with a worked example of the mismatch. If the number 5 can mean two different things between two halves of Apple’s own frameworks, the odds of every photo viewer, email client, upload form and print shop agreeing are not good — and the measurement below is what that disagreement looks like after twenty-six years of one family taking pictures.

Eight possible answers, four of which never happen

The field can hold eight legal values. They cover not only the four rotations but the four mirror images of those rotations, for the case of a photograph that has been flipped as well as turned.

Here is the whole set, with the names Microsoft publishes for each value, and how many photographs in this library carry it.

Value Microsoft’s name for it What it means for the viewer Found in this library
1 Normal Show it as stored. Nothing to do. 27,803
2 Flip horizontal Mirror it left to right. 0
3 Rotate 180 degrees Upside down. Turn it over. 442
4 Flip vertical Mirror it top to bottom. 0
5 Transpose Turn it and mirror it. 0
6 Rotate 270 degrees Stored on its side. The common portrait case. 3,577
7 Transverse Turn it the other way and mirror it. 0
8 Rotate 90 degrees Stored on its other side. Portrait, held the other way. 572
0 — not a defined value — Undefined. Every program decides for itself. 12,390

Two things in that table are worth slowing down over.

Values 2, 4, 5 and 7 appear zero times. Not rarely — never, in 82,707 photographs taken over twenty-six years on a dozen different devices. Half the rule book covers mirrored photographs, and ordinary cameras simply do not produce them. They exist for scanners, for film holders loaded back to front, and for software that has flipped something deliberately. If you are trying to understand your own photographs, there are really only four cases: nothing to do, upside down, on its side, on its other side.

Microsoft and the camera industry describe value 6 differently, and both are right. Microsoft’s published enumeration calls value 6 “Rotate 270 degrees”. The camera industry’s own specification, which defines the field, describes value 6 as the picture having been turned 90 degrees. They are not contradicting each other: one is naming the correction a viewer must apply, the other is naming what the camera did. But it means that two authoritative documents attach opposite-sounding numbers to the same photograph, and anybody writing software from one of them while testing against the other has a bad afternoon ahead. This is the same hazard Apple documents inside its own frameworks, visible at industry scale.

A real library, counted

Requirements and specifications are easy to find. What is missing everywhere is the other half of the question: in a real collection of photographs, how often does any of this actually arise? So we counted one. A single family library of 82,707 JPEG photographs, filed by year from 2000 to 2026, read on 3 November 2026.

The first result is the one that explains why the problem feels random:

What the file says about its orientation Photographs Share
Says nothing — no orientation field at all 37,920 45.9%
Says “normal, nothing to do” 27,803 33.6%
Says a value the standard does not define 12,390 15.0%
Says “turn me” 4,149 5.0%
Could not be read at all 3 0.004%

Almost half the library never raises the question. That is the reason this is so confusing in practice: for 37,920 photographs there is no note, no disagreement and no possible problem, so most of what you look at is fine and the trouble arrives in small handfuls with nothing obvious in common.

The 4,149 are the ones that depend on the note. Set against the 29,111 photographs in this library that are stored portrait outright — pixels taller than wide, no interpretation required — they are about one in eight of all the upright pictures in it. Seven in eight portrait photographs here need no cooperation from any program. One in eight needs every program to agree.

Then we split the 4,149 by the year the photograph was filed under, and the shape of the result was not what we expected:

Year Photographs Stored sideways with a note Share
2000–201614,92680.1%
20178,418570.7%
20186,9283314.8%
20197,58977510.2%
20207,57882710.9%
20217,4761,71322.9%
20226,3314086.4%
202310,945280.3%
2024–202610,59220.02%

Nothing for sixteen years, a steep climb to nearly a quarter of everything taken in 2021, and then a collapse back to almost nothing within two years. This is not a story about standards improving or software getting better. It is a story about which handset was in somebody’s pocket, and the per-device figures make that plain:

Camera maker named in the file Photographs Stored sideways with a note Share
OnePlus37,2673,71610.0%
No maker named34,282230.1%
HTC9,09000.0%
Apple89038543.3%
Sony86740.5%
Canon12100.0%
Olympus, Nikon, Fujifilm and others1902111.1%

Three phone makers, three completely different habits, all in one family’s photographs. HTC wrote 9,090 photographs into this library and not one of them is stored sideways: that phone turned the pixels before saving. Apple relies on the note for 43.3% of the photographs it contributed, which is simply the share of them that were taken in portrait, exactly as its documentation says. OnePlus sits between the two at 10.0%, across by far the largest number of files.

This is the practical finding of the whole exercise. The answer to “are my photographs affected by this?” is not a property of your library, your software or the year. It is a property of the phone that took each one — which is why the problem arrives in clumps, why it looks random, and why it appeared and disappeared in this library within four years without anyone doing anything.

The 12,390 photographs with an orientation that does not exist

The result we did not expect is in the fourth row of the first table. 12,390 photographs — 15.0% of the library — carry an orientation field whose value is 0.

Zero is not one of the eight. The field is defined to hold 1 to 8, Microsoft’s own enumeration lists exactly those eight with a name for each, and 0 is not among them. These files are not corrupt and they open perfectly; something simply wrote a placeholder into the field instead of leaving the field out.

What happens next is the interesting part, and the honest answer is that nothing in particular happens. A standard that does not define a value also does not define what to do when you meet it. A program can reasonably treat 0 as “normal”, or as “unknown, leave it alone”, or as “invalid, ignore the whole block”, or it can read it as an index into a list of eight and reach for an item that is not there. All four are defensible readings and they do not all produce the same picture on the screen.

We are not going to tell you which program does which, because we did not test that and guessing would be worse than useless. What we can say is where these files came from, and it is a narrow source: the great majority carry no camera maker at all in their metadata, which is the signature of a file that has been through other software rather than straight off a camera. A photograph written out by an export, a converter, a messaging app or a web upload is usually rebuilt from scratch, and whatever rebuilt it had to decide what to put in that field. Writing 0 is what you get when the answer is “no information” and the field cannot be left empty.

The practical consequence is small but real: those 12,390 photographs are the ones most likely to behave differently in two programs, because they are the ones where the two programs are not reading a disagreement so much as filling in a blank.

One photograph, two places to write the answer

There is a second layer to this that almost nobody encounters deliberately and quite a few people encounter by accident. A JPEG has more than one place to keep its orientation.

Microsoft’s published policy for the property lists its read paths in order, and there are two of them:

Order Path, as Microsoft publishes it In plain terms
1 /app1/ifd/{ushort=274} The camera’s own block at the front of the file
2 /xmp/tiff:Orientation A second, newer block of information in the same file

The same two appear in Microsoft’s write paths and remove paths, in the same order. So a photograph can hold two answers to the same question, and when they differ the order decides which one wins — for Windows. A program that reads only the second block, or reads them in the other order, reaches the other conclusion from the identical file.

This is not a hypothetical. The second block is where photo managers and editors like to keep their own information, so the two can easily be written by two different pieces of software years apart. It is the same structural problem described in why a photo’s date is kept in a different file: when one fact has two homes, something eventually writes to one of them and not the other, and after that the file disagrees with itself.

The web changed its mind in April 2020

If you have ever put a photograph on a web page and had it appear sideways for some visitors and upright for others, this is why, and it has a date on it.

For most of the web’s history browsers ignored the note. An image was drawn as stored, and a page author who wanted a portrait photograph shown upright had to make sure the pixels were upright. That changed, and it changed at different times in different browsers:

Browser Version from which the note is honored by default
Firefox26
Safari13.1 (13.4 on iPhone and iPad)
Chrome, Chrome for Android and Edge81

The last of those arrived in April 2020, and the web platform’s own compatibility records date the point at which all the major browsers agreed to 13 April 2020. Mozilla’s documentation for the setting that controls it now gives its initial value as from-image, described as: “The EXIF information contained in the image is used to rotate the image appropriately.” Honoring the note is the default, and has been for a few years.

There is a nice coda. The same documentation carries a warning that you cannot fully turn the behavior off any more:

“image-orientation: none; does not override the orientation of non-secure-origin images as encoded by their EXIF information, due to security concerns.”

Which is a fair summary of the whole subject: after twenty years of disagreement the industry concluded that the note should be obeyed, and then concluded that letting anyone opt out was itself a hazard. It is now the most reliable it has ever been — and every photograph taken before April 2020, and every program that is not a browser, is still outside that agreement.

Five things widely repeated that are wrong

“Rotating a photo does not change the file.” It changes the file either way. If the program writes the note, it has rewritten part of the file; if it turns the pixels, it has rewritten all of them and compressed the picture again. There is no version of rotating a photograph that leaves the file untouched, which matters for the file’s dates — see below.

“Rotating a photo always loses quality.” Not always. A program that writes the note changes a couple of bytes and loses nothing at all, which is exactly why the note exists. A program that re-encodes the picture does lose something. Most modern photo apps take the first route for plain 90 and 180 degree turns, and you usually cannot tell from the outside which route a given program took.

“It is a phone problem.” It is a sensor problem, and every camera has a sensor bolted in one way round. Interchangeable-lens cameras write the same field, and in this library the only photographs from a scanner-style source carried no field at all. What differs between devices is not whether they face the problem but which of the two solutions they chose, and that is a choice their makers made independently.

“If it looks right in Windows it is right.” It is right in Windows. Windows reads the note, which means a photograph that is stored sideways looks perfect in Explorer and in the Photos app while still being a sideways file. That is the precise situation that produces a sideways email attachment from a folder where everything looked fine.

“Re-saving it as a PNG will fix it.” It will, and at a price nobody mentions. PNG has no orientation field, so a converter has to turn the pixels, which does settle the question permanently. But the conversion also discards the camera’s whole block of information, including the date the photograph was taken, and it typically produces a much larger file. Fixing a rotation by converting the format is the most expensive possible way to do it.

The part specific to dates

Here is the join between this subject and the one this site is mostly about, and it catches people during exactly the activity you would hope was safe: tidying up.

Rotating a photograph rewrites its file. Even in the cheap case, where only the note changes, the file has been opened and written, and Windows updates the file’s modified timestamp when that happens. The date the photograph was taken lives inside the camera’s block and is not touched — but the date the operating system shows you in a folder listing, and the date a great many programs sort by, has just become today.

Sit down for an evening and rotate two hundred holiday photographs the right way up, and you have given two hundred photographs today’s file date. Nothing is lost: the real date is still in the file, which is the whole reason the inside-the-file date is the one worth trusting. But any tool that falls back on the file’s own timestamp — and that includes a plain folder sort — now puts that holiday this week. It is the same mechanism described in why the same photo has three different dates, triggered by housekeeping rather than by a copy.

The library we counted shows the fingerprints of this. Of the 4,149 photographs stored sideways, several hundred name a piece of software rather than a camera as the last thing to write them — iOS version numbers in the hundreds, and twenty files still naming Picasa, an application retired in 2016. Those are photographs that were opened and written again after the camera was finished with them, and every one of those writes moved a timestamp.

Which gives the practical rule: if you are going to rotate a batch of photographs, get their dates right first, or be ready to fix them afterwards. Doing it the other way round means the tidy-up has quietly undone the dating, and fixing wrong photo dates is the step to repeat, not the one to skip.

What to do, in the order that helps

Most of the time the answer is to do nothing, because a photograph that is correct in the places you use is correct. This list is for when it is not.

First, find out whether the file is sideways or the program is. Open the photograph’s properties in Windows, go to the Details tab, and look for a dimensions line. If a portrait photograph reports more pixels across than down, the file is stored sideways and relies on the note. That single reading tells you which of the two problems you have, and everything else follows from it.

If the file is sideways and one program disagrees, fix the program, not the photograph. A sideways file that looks right in four places and wrong in one is a file that is doing nothing wrong. Rotating it to satisfy the fifth program breaks the four, and you will be back in a week.

If you do need the pixels turned, do it once, deliberately, to a copy. Keep the original. A rotation that rewrites the pixels is not reversible without another rotation, and each pass through a JPEG costs a little quality. One copy, rotated once, is the cheapest version of this.

Rotate before you convert, never after. If a photograph has to become a PNG or go into a document, turn it first and convert second. Converting first hands the question to a program that may not read the note, and the result is a permanently sideways file with no note left to explain it.

Check an upload before it matters, with the actual uploader. Print shops, photo books and forms are where this bites, because they are one-way: by the time you see the proof the file is in their system. Upload one portrait photograph from the batch and look at the preview. If it is sideways there, it will be sideways in all of them, and you have found it on the first file rather than the two hundredth.

Do the dates before the rotating. For the reason in the section above: rotating moves file timestamps, and a library that was sorted correctly this morning will not be sorted correctly tonight.

How we counted

Every figure in this article comes from one library, read once, on 3 November 2026. It is a real family collection rather than a test set: 82,707 JPEG photographs, filed in year folders from 2000 to 2026, with everything in it — phone pictures, camera pictures, scans, screenshots, exports and photographs other people sent.

The method is deliberately dull, because it has to be checkable. Nothing was decoded, rotated, edited or written. A short script opened each file read-only, read the first 192 kilobytes, walked the JPEG marker chain to find the camera’s information block, and read four fields out of it: the orientation value, the maker, the model, and the name of the last software to write the file. The photograph’s stored width and height came from the file’s own SOFn marker, which is the JPEG’s statement of its own pixel dimensions. The year came from the library’s own top-level year folders, not from any date inside the files.

Three files of the 82,707 could not be read and are reported as such rather than excluded quietly. 465 contained no camera information block at all and are counted in the 37,920 that say nothing about their orientation, because from a viewer’s point of view those two cases are identical.

No filename, folder name or subject appears anywhere in the results. The script’s output is counts and nothing else — counts by orientation value, by year and by named maker — which is why this article can quote a family’s library without publishing anything from it.

One limitation worth stating plainly. We measured what the files say. We did not test how any particular program interprets them, and the article deliberately avoids claiming that any named application gets this right or wrong, because that would need a different experiment than the one we ran.

Where this comes from

Sources read on 3 November 2026. The quotations and figures above come from other people’s documentation as it stood that day. Policies and specifications change, and they change quietly — so if you are about to rely on one of these numbers, open the link and check it rather than taking our word for a page we read months ago.

Fix it once, everywhere

A rotation stored as a note rather than as pixels is obeyed by some programs and ignored by others. PDR settles it in the file itself.

Free Test Drive Buy Now

Frequently asked questions

Why is my photo sideways in an email but upright on my computer?

Because the photograph is probably stored sideways in the file with a small note attached saying how far to turn it, and your computer reads that note while the other program does not. Microsoft documents the field and explains the reasoning: the note exists so that software can orient the image properly instead of rewriting the pixels, which it says can result in a loss of fidelity. The same documentation also states that the property is not meant to be displayed in the user interface, which is why there is nothing on screen to look at when this happens. Nothing is wrong with the file. The way to confirm it is to open the photograph's properties and read the dimensions on the Details tab: if a portrait picture reports more pixels across than down, it is one of these files.

What is EXIF orientation?

It is a single small number stored near the front of a JPEG that tells a program which way to turn the picture before showing it. Microsoft gives its address on disk as the 274th entry in the camera's information block, and publishes a name for each of the eight legal values: Normal, Flip horizontal, Rotate 180 degrees, Flip vertical, Transpose, Rotate 270 degrees, Transverse and Rotate 90 degrees. It exists because a camera sensor is fixed in the body and reads the scene the same way however the camera is held, so something has to record that the camera was turned. In practice only four of the eight ever turn up in ordinary photographs: in a library of 82,707 we found the four mirrored values exactly zero times.

Does an iPhone store portrait photos sideways?

Yes, and Apple says so in its own developer documentation. Its wording is that the pixel data for an image captured by an iOS device camera is encoded in the camera sensor's native landscape orientation, and that when the user captures a photo while holding the device in portrait orientation, iOS writes an orientation value into the file so that software can apply a 90 degree clockwise rotation when displaying it. So every portrait photograph from an iPhone is a landscape file plus a note. This is the better design rather than a defect, for the reason Microsoft gives: the alternative is rewriting the pixels, which costs quality. In the library we measured, 4,025 of the 4,149 photographs carrying a rotate note had more pixels across than down, which is this mechanism visible in a folder listing.

Does rotating a photo reduce its quality?

It depends on which of two things the program does, and you usually cannot tell from the outside. If it writes the orientation note, it changes a couple of bytes and loses nothing, which is precisely what the note is for. If it re-encodes the picture, the photograph is decoded, moved and compressed again, and that loss is permanent. Most current photo applications take the cheap route for plain 90 and 180 degree turns, and older ones were more likely to re-encode. Either way the file has been written, so the file's modified date changes. The safe habit for a photograph you care about is to rotate a copy once rather than the original repeatedly.

Why do some photos rotate correctly and others do not?

Because it is decided by the device that took each photograph, not by your computer or your software. We counted a family library of 82,707 photographs and the per-maker figures were nothing alike: 9,090 photographs from HTC phones contained not one sideways file, because that phone turned the pixels before saving; 43.3% of the Apple photographs relied on the note; OnePlus sat at 10.0% across 37,267 files. Split the same library by year and the share rises from almost nothing before 2017 to 22.9% in 2021 and falls back to 0.3% by 2023, which tracks which handset was in use rather than any change in software or standards. That is why the problem arrives in clumps with nothing obvious in common.

How do I tell if a photo is stored sideways?

Right-click it in Windows, choose Properties and open the Details tab, then read the dimensions. If the photograph looks like a portrait picture on screen but the dimensions say it is wider than it is tall, the pixels are stored sideways and what you are seeing is a program obeying the note. If the dimensions agree with what you see, the pixels themselves are upright and the file will look the same everywhere. That one reading is worth doing before any batch rotation, because it tells you whether you are fixing the file or fixing a program that disagrees with it.

Will converting a photo to PNG fix the rotation?

It will fix the rotation and cost you more than you expect. PNG has no orientation field, so a converter has to turn the pixels to produce a correct picture, which does settle the question for good. But the conversion normally discards the camera's entire information block along with it, including the date the photograph was taken, the camera model and any location, and a PNG of a photograph is usually several times larger than the JPEG it came from. Converting the format to solve a rotation is the most expensive available fix. Rotating within the original format, once, to a copy, achieves the same thing and keeps the dates.

Do web browsers respect EXIF orientation?

They do now, and the change is recent enough that plenty of older pages were built on the assumption that they did not. Firefox has honored it since version 26, Safari since 13.1 on the desktop and 13.4 on iPhone and iPad, and Chrome, Chrome for Android and Edge since version 81; the web platform's own compatibility records put the point at which all of them agreed at 13 April 2020. Mozilla's documentation gives the default behavior as from-image, described as using the EXIF information in the image to rotate it appropriately, and adds a warning that the opt-out does not work on images from non-secure origins for security reasons. So a portrait photograph uploaded to a web page in 2018 may well have appeared upright to some visitors and sideways to others.

Can a photo have two different orientation values?

Yes, and this is a real cause of two programs disagreeing about the same file. Microsoft's published policy for the orientation property lists two read paths in priority order: the camera's own block at the front of the file, and a second, newer information block in the same file that photo managers and editors like to write to. The same two appear in its write and remove paths. If the two disagree, the order decides which one Windows believes, and a program that reads only the second, or reads them in the other order, reaches the opposite conclusion from an identical file. It is the same hazard as a photograph whose date is kept in two places: eventually something writes to one and not the other.

What does orientation value 0 mean?

Nothing, officially, and that is the problem. The field is defined to hold values 1 to 8 and Microsoft's own enumeration names exactly those eight, so 0 is outside the standard. We found it in 12,390 of 82,707 photographs, and the great majority of those named no camera maker at all, which is the signature of a file rebuilt by other software rather than written by a camera. A program meeting 0 can reasonably treat it as normal, as unknown, or as invalid, and those readings do not all put the same picture on the screen. These are therefore the files most likely to behave differently in two applications, not because the applications disagree about a value but because they are each filling in a blank.