Android 1.6 Camera Rotation?

I posted this on the android dev forums, but wanted to contact us.

One of the activities in our application is photography. Previewing the image shows the correct path on the screen in 1.5 and 1.6, but when it is saved, it retains jpg 90 rotation.

I can rotate it in real time when displayed, and I think I could save it after saving. My problem is that I want to save it correctly when shooting.

My app compiled in 1.5 works fine. I had problems with w / 1.6 memory due to the image size, which was strange b / c, the image size increased when taking photos with a photo with a surface holder / imagecapture Call me back. It seems I have fixed the re-rendering of these images by resizing them using a bitmapfactory matrix. But my camera now rotates all 90 degrees. It looks like my redefinition of the Changed surface does nothing, where I set the rotation to 90 (I can't remember why, it was 10 months ago!). I tried rotating the camera parameters at 90 degrees, 0 degrees. It doesn't seem to do something ... any thoughts?

+3
source share
1 answer

Camera drivers do not know the orientation of the device. In 1.5 and 1.6, you need to call the .set parameters ("rotation", degree) to tell drivers about the rotation before calling takePicture (). In version 2.0 there is a new setRotation API (see below). Note that some devices rotate all images for you, and some simply set the orientation in the EXIF ​​header.

http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation(int)

. , , . 2048x1536, 0. 90 , 90. OrientationEventListener . EXIF ​​ . EXIF. Jpeg , EXIF ​​ 1 ( № 0 , № 0 - ).

. 0, 90, 180 270

+6

Source: https://habr.com/ru/post/1720795/


All Articles