5

I edited this question on Bicycles SE to convert the images from external links to tags. The images contain an EXIF orientation attribute which is used to display the image appropriately as a link, but it is not respected when the image is displayed within SE.

Can SE implement the ability to read the image EXIF and use the Orientation to display the image correctly?

  • Please see my updated answer for EXIF orientation related findings – HackerKarma Aug 12 '15 at 3:37
12

If you include the image like you did with an <img> html tag the browser is responsible for fetching and displaying the image. Except for the url, the bytes making up the image never reach or pass any SE server (unless an employee decides to visit that question while doing maintenance on the server).

So there is not much SE can implement to fix that.

Fortunately you can achieve what you want by using the Stack Exchange Image upload feature and then it turns out imgur rotates the image for you...

uploaded to i.stack.imgur

image in imgur

for reference direct embedded with <img> tag

Your client (browser) may have decided to show this image also in its correct orientation. Thanks iOS/Mobile Safari for that. On IE11/Win7 of course the image is not on the right orientation (nor in Chrome/FF or Safari on Windows)

i.stack.imgur usage benefit

Uploading the image to imgur is a better option as well because those gets retained for ever while external hosted images might get deleted, making the question less useful, if not useless.

  • 3
    Ok, sorted it out. I can just use the SE upload widget and refer to the image by its URL. Quite easy, thanks for the info and example. – dlu Aug 11 '15 at 22:11
  • @rene it is funny that iOS shows both images correct. I guess they use the EXIF data already in their browser... – Patrick Hofman Aug 12 '15 at 8:44
5

Stack Exchange uses imgur for uploading and hosting the images. Stack Exchange imgur's API does respect/recognize the EXIF data and auto-rotates the image to their correct orientation during the upload.

As per the the Metapicz (popular EXIF/meta data viewer tool for images) EXIF data analysis report you will see: (I used the original image URL: http://janis.tokyo/bike/IMG_0796.JPG)

Orientation: Rotate 90 CW

Please pay attention to the preview image shown on the report page. Now, when you upload the image using SE's imgur interface, it extracts the Orientation attribute's value i.e. Rotate 90 CW from the EXIF data and rotates the image accordingly. You can see how the uploaded image looks like in rene's answer.

On the side note, I would also like to point out that imgur will strip the EXIF data once the image is uploaded to their server. You can see the Metapicz report on the above uploaded image (http://i.stack.imgur.com/fGYeGm.jpg)

Why does imgur strips the EXIF data?

Here is a reply from imgur userecho question Where is the EXIF data? :

This is one of the features of the service. exif data is removed because the images are shared publicly and the developer does not want hidden information to leak accidentally by users who might have no idea what exif information is stored in the photos. I do not think there is any setting available on imgur platform that retains the data if you so desire.

Here is reply from Alan Schaaf (Founder of imgur):

Sorry, but exif data is striped on purpose to keep the anonymity of the uploader. This will not change.

  • @rene Sorry I could not reply to ur comment in-time but I will do research and post my findings. – HackerKarma Aug 11 '15 at 21:32
  • @rene please see my updated answer for add-on – HackerKarma Aug 12 '15 at 3:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .