Sebastian Hojas
Sebastian Hojas

Reputation: 4210

How does the JPEG orientation feature work?

I do have some images (example) which will be displayed differently depending on the software I am using.

When I open the image in my browser, the picture loads from the right side to the left (in contrast to other images which are loading from top to bottom).

Browser:
Image Browser

When I display the same image in an Android Application (via UrlImageViewHelper) the image will be displayed with an rotation of 90°.

Android:
Image Android

'Normal' Images (that are loading from the top downwards) are being displayed correctly in my application.

Questions

  1. Where does the browser get the information about the orientation of the image?
  2. How could I implement an Android ImageView that is aware of the original orientation of the image?

Upvotes: 2

Views: 451

Answers (1)

koush
koush

Reputation: 2962

Try this:

Put the rotated jpeg in your res/drawable. Set an ImageView to use that. See what happens.

UrlImageViewHelper doesn't actually do special image loading. It just uses the BitmapFactory like it should.

This is very likely to be an Android framework/libjpeg bug where jpeg rotation EXIF tag is not being honored.

Upvotes: 2

Related Questions