Background: I am writing a camera app for a messenger program. I cannot save the captured image to persistent disk at any time. The camera must support all orientations.
If you are using Glide library you can get the Exif orientation from an InputStream:
InputStream is=getActivity().getContentResolver().openInputStream(originalUri); int orientation=new ImageHeaderParser(is).getOrientation();