Exif data TAG_ORIENTATION always 0

后端 未结 3 1810
别那么骄傲
别那么骄傲 2020-12-05 07:03

I need to know the orientation of an image from the gallery (taken by the camera). My initial approach was to use MediaStore.Images.Media.ORIENTATION which was working for m

3条回答
  •  感情败类
    2020-12-05 07:39

    My solution:

    Remove any checking for orientation from exif data. I could not find one instance where it was accurate.

    Use the standard String[] orientationColumn = {MediaStore.Images.Media.ORIENTATION}; to get an orientation.

    If this is 0 use decodeStream...

    if(o.outHeight > o.outWidth){
      //set orientation to portrait
    }
    

    else it is landscape

提交回复
热议问题