In my tests, a Bitmap
created by BitmapFactory.decodeFile()
doesn\'t respect EXIF header.
For example, with portrait images taken by a devices
Is there a way to make BitmapFactory.decodeFile() respect EXIF and produce a correct Bitmap?
No, sorry.
what is the recommended pattern to handle this issue?
Use the support library's ExifInterface
to determine the desired orientation. Then, depending upon your use of the Bitmap
, either rotate the view (e.g., ImageView
) or rotate the Bitmap
. This sample project illustrates both approaches, though I use a separate set of EXIF code, as some things that I use in that sample are not supported by the support library's ExifInterface
.