Is it possible to make BitmapFactory.decodeFile() respect EXIF?

前端 未结 3 401
走了就别回头了
走了就别回头了 2021-01-21 07:36

In my tests, a Bitmap created by BitmapFactory.decodeFile() doesn\'t respect EXIF header.

For example, with portrait images taken by a devices

3条回答
  •  醉梦人生
    2021-01-21 07:57

    You can do this with Glide now. See the "Background Threads" section here:

    https://bumptech.github.io/glide/doc/getting-started.html

    Bitmap bitmap = Glide.with(context).asBitmap().load(new File(fileName)).skipMemoryCache(true).submit().get();

    Glide takes into consideration EXIF. You'll need to load it on a background thread. I was using Glide 4.9.0

提交回复
热议问题