1

I use the camera API to take photos. The orientation of the preview(surfaceview) is ok. But when I view a photo that I've taken, it's the wrong orientation. So how can I fix it? I use the HTC sensation.

p.s. like this: When I take a photo in portrait, it displays at an angle of 90 degrees counter-clockwise.

When I take photo at an angle of 90 degrees counter-clockwise, it displays in portrait.

dshapiro
  • 1,075
  • 14
  • 24
Zenymax
  • 15
  • 5

1 Answers1

0

check my answer for this question to rotate image

you use a Matrix to apply the required rotation. if you don't the right orientation you just use ExifInterface.TAG_ORIENTATION to get it then you rotate your image

Community
  • 1
  • 1
ColdFire
  • 6,764
  • 6
  • 35
  • 51
  • where should i implement this code? i tried at public void onPictureTaken(byte[] data, Camera camera) and save. but it wrong. i just want it right rotation like preview – Zenymax Oct 22 '12 at 11:18
  • you can use this to get the bitmap to use inside your `ImageView` used for preview..Is this clear? – ColdFire Oct 22 '12 at 11:34
  • i see that. but do you have any idea about saving right image (image with right orientation) when you finish call onPictureTaken(byte[] data, Camera camera) ? – Zenymax Oct 23 '12 at 03:22