I receive a lot of emails with photos attached that have been taken in a portrait orientation. Most modern digital cameras and smart phones have orientation sensors that tell the camera if it's been turned on end. When this happens, rather than actually rotate the picture, the camera sets a flag in the image's EXIF data to communicate which way is up in the photo.
When viewed on the web, the code used to display the photo on a web page can be written to read this information and display it properly on the page. The problem arises when you just want to use the browsers native ability to view an image by itself. Most web browsers don't provide this function and will just display the image in landscape mode.
An example of this can be seen when receiving a photo attachment in Gmail. The image will be shown in its proper orientation in the image preview as can be seen in the screen capture below.
When you click on "view" to see the image at a larger scale, you get something like this.
How to fix the image rotation in Chrome or Chromium
Thankfully, someone has written a nice little plug-in for Chrome that will cause the stand alone image to display in the properly rotated orientation based on the EXIF data. From within the Chrome or Chromium browser, go to the Chrome Web Store. Enter "exif rotate" into the search box.
Find a plug-in called EXIF Image Orientation and click on "ADD TO CHROME". Click on "Add" at the confirmation pop-up. The plug-in should now be installed.
Go back to your email with the attached image and click on "view" again. At first it will come up in landscape mode like before, but as soon as it's completely done loading, it will switch to portrait mode as seen below.
You are now free to enjoy your email photo attachments.
Do you know where this photo was taken? Hint: it's somewhere in the USA.