The curious case of the rotated jpg...

Quote Originally Posted by Bernice Loui View Post
How annoying it is when a photo doesn't display in the correct orientation... even though it looked fine before it was uploaded.

Why does it happen? As we all know, jpg images (digital photos particularly) also contain exif data such as image size, shutter speed, aperture etc. One item recorded in the exif data is Orientation. This can have one of nine different values. Eight of the values describe which sides of the visual image relate to both the first row and column of the image data (which can be visualised as a grid), and the ninth value means that orientation information is 'not given'.

Most modern operating systems now interpret orientation data correctly but some software (or portions of software) may still have problems with it. For instance it is perfectly feasible that the a piece of software may show an image in the correct orientation in an upload routine but then display it incorrectly within another screen (in a post for instance).

To add further complication the images at fault are often from mobile phones. They sometimes seem to have their own idea of what is up/down/left/right, and it is said that some may even write the orientation data incorrectly.

The solution? If you can, always download the images to a trusted machine first and check (or rather force) the orientation to be what you want it to be.

I use (and have done for years) the free image viewer FastStone* on Windows to browse images in folders (it also does batch conversions which is pretty cool). When I have saved images from a phone onto the PC I do one of two things:

- If they are obviously in the wrong orientation I rotate them until they are correct
- Even if they look to be in the correct orientation I rotate them 90 degrees clockwise, then back 90 degrees anti-clockwise. This invariably does the trick.

In both cases save the image afterwards.

Apologies for wandering far off-topic but I thought it was worth mentioning

* I have no affilation or connection with this software. Other software and operating systems are available, and hopefully the theory above will give the same result. YMMV, try it and see!
** This probably doesn't help people posting directly from their phones...
*** I believe vBulletin v5 may try a bit harder to orientate images correctly?