Orientation 6 and 8 are swapped
alexkli opened this issue · 3 comments
The examples on http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/ are wrong. See bottom of http://sylvana.net/jpegcrop/exif_orientation.html
Checking against not that page, but against the actual Exif specification (version 2.2), they are correctly orientated.
Looking at the images before proper orientation, for Landscape_6.jpg
, the text label right
is at the top (0th row), while top
is at the left (0th column). And this is what the spec says about orientation value 6
:
6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
Similarly, Landscape_8.jpg
, Portrait_6.jpg
, and Portrait_8.jpg
, also conform to the specification. I also checked all the Exif orientation values and they match the file names.
The full extract from the specification:
Orientation
The image orientation viewed in terms of rows and columns.
Tag = 274 (112.H)
Type = SHORT
Count = 1
Default = 1
- 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
- 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
- 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
- 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
- 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
- 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
- 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
- 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
- Other = reserved
@alexkli afaik the orientations are correct - feel free to re-open this if you wish to discuss it further.
I don't rember exactly, but think I was refering to the diagram from 80sidea at the start of the article. I think it gives the wrong impression - without context, anyone would think the stored image is a regular F, and the diagram shows what you would get if applying the transformations. In that case it would be wrong for 6 and 8.
If it shows the stored image instead and the numbers are what orientation it would take to get a regular F displayed, then it's correct - but that would not be obvious to the reader.