Posted by Neil Wyatt on 28/05/2018 23:19:46:
Posted by SillyOldDuffer on 28/05/2018 09:59:55:
The image has no intrinsic means of understanding up, down, right and left; these are decided by more-or-less intelligent guesswork in the camera, and added to the image as a suggestion. Bear in mind too that images can be made without needing a real scene or a camera at all.
Cameras usually do a good job, but not always. Even if they get it right, for historic reasons, there are at least three ways of suggesting orientation within image data and they need not agree, nor is there any law that says the software that decodes and displays an image has to obey the suggestions. And of course the software has no knowledge of reality either. It's a bit of a mess.
Sorry Dave, but you are completely wrong!
Any phone or camera remotely worth its salt will contain an accelerometer taht tells it EXACTLY what way up the camera was when the photo was taken.
But as many phones have all the controls on screen, it's easy to use them 'upside down'.
As orientation data is stored in the Exif information and the byte order of the image isn't changed software that doesn't look at the exif will just use the default orientation.
Neil
Me completely wrong? Surely not! Well not more than two or three times a day…
Anyway, in this instance I plead 'not guilty', specially as I said 'Cameras usually do a good job.'
As to the comment 'Any phone or camera remotely worth its salt will contain an accelerometer' . Four points:
- The specification of the £40,000 Hasseldblad H6D-400C doesn't mention it having an accelerometer. (No lens for that money either!)
- Camera accelerometers aren't meaningful in outer space, where I spend loads of time.
- On earth accelerometers don't always do what the photographer expects, especially pictures taken at odd angles.
- If a camera is pointing directly up (on a telescope) or directly down (on a microscope), which way round are portrait and landscape, and – even if there was a good answer – how does having an accelerometer help?
Really I'm just saying image rotation is unreliable because the programmer has too many choices when it comes to interpreting image orientation. Assuming JPEG rather than Raw or another format, should the program:
- Display the image as stored, or
- Use the JPEG orientation flag which is usually the cameras notion up/down/right/left, or
- Display Landscape when pixel width is greater than pixel height, otherwise Portrait, or
- Decode the EXIF flag to determine if the pixel rows and columns start top, bottom, right, left (Eight ways a camera is allowed to record or export the image ), or
- Decode other orientation meta-data (like JFIF / IPTC etc ) and use that.
This can get really complicated, for example exactly how should a program that rotates an existing image change the metadata? What matters more, what the camera saw, or the change?
These and other ambiguities embedded in the image before it arrives on your computer mean that software written to display images usually allows the user to rotate them. Unfortunately the display program may remember the preference in a way not meaningful to any other software, causing yet more confusion when you share the picture or view it with something else.
Dave
Edited By SillyOldDuffer on 29/05/2018 13:20:40