title: setRotation(90) to take picture in portrait mode does not work on samsung devices
body: <p>According to the documentation, <a href="http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation%28int%29" rel="noreferrer">setRotation(90)</a> should rotate the captured JPEG picture (<a href="http://developer.android.com/reference/android/hardware/Camera.html#takePicture%28android.hardware.Camera.ShutterCallback,%20android.hardware.Camera.PictureCallback,%20android.hardware.Camera.PictureCallback,%20android.hardware.Camera.PictureCallback%29" rel="noreferrer">takePicture</a> in landscape mode.</p>
  
  <p>This works fine on a HTC phone, but does not work on Samsung Google Nexus S and Samsung Galaxy S3. Is this a bug?</p>
  
  <p>I know that I can use the matrix transform rotation, but wish the OS can do this more efficiently, and don't want to risk over-rotating on some other devices.</p>
  
  <p><strong>edit</strong></p>
  
  <p>Setting <code>camera.setDisplayOrientation(90);</code> made the preview to be in portrait mode, however it did not have any affect on the picture taken.</p>
  
  <p>Further, Besides <code>setRotation</code>, I have also tried to set the picture size - where I flip <code>h</code> with <code>w</code>: <code>parameters.setPictureSize(1200, 1600);</code>. This also did not have any affect.</p>
  
  <p><strong>solution</strong></p>
  
  <p>Apparently Samsung phones set the EXIF orientation tag, rather than rotating individual pixels. As <code>ariefbayu</code> suggested, reading the Bitmap using <code>BitmapFactory</code> does not support this tag. His code sample is the solution, and this solution is also compatible with using <code>inSampleSize</code>.</p>