From d07d73b56af1fa4edc32d5307051f9fcb48a79d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Fri, 5 Jun 2020 18:31:04 +0200 Subject: [PATCH] Fix orientation of image captured by camera. --- .../codigoparallevar/minicards/parts/android/CameraStreamer.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/com/codigoparallevar/minicards/parts/android/CameraStreamer.java b/app/src/main/java/com/codigoparallevar/minicards/parts/android/CameraStreamer.java index 9bf4d6b..9aff9b7 100644 --- a/app/src/main/java/com/codigoparallevar/minicards/parts/android/CameraStreamer.java +++ b/app/src/main/java/com/codigoparallevar/minicards/parts/android/CameraStreamer.java @@ -377,6 +377,7 @@ public class CameraStreamer implements Part { public void onConfigured(@NonNull CameraCaptureSession session) { try { CaptureRequest.Builder requestBuilder = session.getDevice().createCaptureRequest(CameraDevice.TEMPLATE_PREVIEW); + requestBuilder.set(CaptureRequest.JPEG_ORIENTATION, mCameraCharacteristics.get(CameraCharacteristics.SENSOR_ORIENTATION)); requestBuilder.addTarget(surface); //set to null - image data will be produced but will not receive metadata session.setRepeatingRequest(requestBuilder.build(), null, CameraStreamer.this._handler);