EXIF orientation tag value always 0 for image taken with portrait camera app android

前端 未结 4 510
南方客
南方客 2020-11-27 16:24

I have a camera app in portrait mode which takes pictures from both front and back end cameras.I am saving the image in my sd card and try to find the corresponding exif val

4条回答
  •  伪装坚强ぢ
    2020-11-27 16:57

    You are ignoring an Exception at :

        try {
            // Code
            int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
        } catch (Exception e) {
    
        }
    

    Try :

        try {
            // Code
            int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
        } catch (Exception e) {
            e.printStackTrace();
        }
    

    And post logcat. It is never wise to thow away exceptions.

提交回复
热议问题