camerakit-android icon indicating copy to clipboard operation
camerakit-android copied to clipboard

Tablets with natural landscape orientation causes distorted/rotated preview and images

Open Moonbloom opened this issue 9 years ago • 7 comments

I've tested with many phones and tablets, on both the 0.9.17 and 0.9.18 versions (there were some changes to orientation calculations).

The issue happens on both a Google Nexus 10 tablet, and a Samsung Galaxy Tab 4. No other tablets or phones have this issue.

When using both front and rear camera, the preview is distorted, and when an image is taken, it's distorted and incorrectly rotated (even after rotating it according to the EXIF data).

The only similarity/difference i can see is the fact that these two tablets are naturally landscape oriented. All phones and tablets that are naturally portrait oriented behave correctly.

Moonbloom avatar Apr 18 '17 12:04 Moonbloom

This issue is happening to me on Moto X 2nd generation. If the activity containing de cameraView is in portrait view everything is OK. But when i rotate the device to landscape or start the Activity in landscape the camera preview is completely messed up.

victor5171 avatar Apr 20 '17 01:04 victor5171

I am facing that problem on Samsung Galaxy S7

jublikon avatar Apr 20 '17 10:04 jublikon

happen on One Plus 3 too :(

odinnou avatar Apr 25 '17 08:04 odinnou

I had a similar issue and have found that creating a Landscape Layout of activity_main has fixed the issue for me. Preview of the camera in portrait and landscape looks fine now.

mjf009 avatar Apr 30 '17 16:04 mjf009

It seems that actual sensor orientation is not taken into account:

com.flurgle.camerakit.Camera1#adjustCameraParameters

        ...
        Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
        Camera.getCameraInfo(Camera.CameraInfo.CAMERA_FACING_BACK, cameraInfo);

        Log.e("camera", "orientation: " + cameraInfo.orientation);

        invertPreviewSizes = cameraInfo.orientation == 0 ? !invertPreviewSizes : invertPreviewSizes;
        ...

kemsky avatar May 02 '17 19:05 kemsky

So guys, did somebody found resolution of this issue?

azlekov avatar May 19 '17 19:05 azlekov

I am having the same problem. If someone has the solution, let us know

matheuslazarin avatar Jun 09 '17 13:06 matheuslazarin