title: How to rotate and flip bitmap in onPictureTaken
body: <p>I'm finding in <code>onPictureTaken</code> that the bitmap saved is mirrored about the y-axis and rotated 90 degrees clockwise even though the camera preview was not. This is on my Nexus S that's running 2.3.6. The same program running on my Nexus 4 with 4.2 has the resulting bitmap mirrored about the y-axis and rotated 180 degrees clockwise.</p>
  
  <p>This is the code I'm running in <code>onPictureTaken</code>:</p>
  
  <pre><code>@Override
  public void onPictureTaken(final byte[] data, Camera camera) {
      Bitmap picture = BitmapFactory.decodeByteArray(data, 0, data.length);
      String path = MediaStore.Images.Media.insertImage(getContentResolver(), picture, "name" , "description");
      Log.e("tag", "path: " + path); // prints something like "path: content://media/external/images/media/819"
  
      try {
          ExifInterface exif = new ExifInterface(path); // prints this error: "04-25 21:28:21.063: E/JHEAD(12201): can't open 'content://media/external/images/media/819'"
          int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
          Log.e("tag", "exif orientation: " + orientation); // this is outputting orientation unknown
      } catch (IOException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>Can anyone show me how I rectify this given that I seem to be getting different results from different devices? How do I detect the orientation of the resulting bitmap so that I know to rotate it either 90 or 180 degrees counterclockwise?</p>
  
  <p>[EDIT]</p>
  
  <p>I added some more information using the ExifInterface stuff I've been reading about, but that information doesn't seem to pan out...</p>