title: Why is ExifInterface.TAG_ORIENTATION always 0?
body: <p>I want to take a picture and then display it in an imageView.
  But the problem is the orientation because sometimes my image is being displayed the wrong way.</p>
  
  <p>All I found here was to get the information of the orientation out of the ExifInterface like this:</p>
  
  <pre><code>   ExifInterface exif = new ExifInterface(uri.getPath());
      int rotation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL); 
      int rotationInDegrees = exifToDegrees(rotation);
      Matrix matrix = new Matrix();
      if (rotation != 0f) {
  matrix.preRotate(rotationInDegrees);
  }
      Bitmap adjustedBitmap = Bitmap.createBitmap(sourceBitmap, 0, 0, width, height, matrix, true);
  </code></pre>
  
  <p>with</p>
  
  <pre><code>     private static int exifToDegrees(int exifOrientation) {        
           if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90) {  return 90;  } 
           else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180) { return 180;  } 
           else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270) {   return 270;  }            
           return 0;    
        }
  </code></pre>
  
  <p>I got this from [<a href="https://stackoverflow.com/questions/7286714/android-get-orientation-of-a-camera-bitmap-and-rotate-back-90-degrees]">Android get Orientation of a camera Bitmap? And rotate back -90 degrees</a></p>
  
  <p>the problem is that I always get an orientation of 0.
  And the image is always displayed in landscapeview.
  Can anyone help?</p>