2

I want to get the orientation of bitmap images. I tried the following-

Bitmap test = MediaStore.Images.Media.getBitmap(getContentResolver(), Uri);
int w = test.getWidth();
int h = test.getHeight();

However it returns w=2592 & h=1944 (for all images captured by the camera) irrespective of whether it was taken in landscape or portrait mode. Is this the correct approach or is there any better way to do this?

Dave Morris
  • 569
  • 1
  • 8
  • 17

1 Answers1

3

You need to use ExifInterface if you are using API level 5 or higher. See this post.

Community
  • 1
  • 1
Sourav
  • 1,214
  • 14
  • 24