QML Camera Image Orientation
-
wrote on 26 Jul 2019, 14:12 last edited by
Hi.
I am struggling with the orientation of a photo taken with a QML Camera on Android.
Qt 5.12.2The image preview is a QML Image with
autoTransform:true
. When before triggering imageCapture i look up the device orientation with aOrientationSensor
and rotate the image (after capture is done) according to the devices orientation:function orientationToAngle(orientation, w, h) { switch (orientation) { case 2: return 180 case 3: return -90 case 4: return 90 } return w > h ? -90 : 0; }
This works for most of the cases.
But it seems that the Camera and the OrientationSensor have different interpretations of when the Face is up or not.
I end up with 180° rotated previews if i hold my device roughly 30-45° the right side up.Is there a fool-proof way of getting this right?
There is no Metadata available in the image/the camera.All i want is a fullscreen camera with image-preview...
thanks for any tips.
ingo -
wrote on 26 Jul 2019, 14:15 last edited by
i found this in the forum:
https://forum.qt.io/topic/83036/confuse-with-camera-orientation/2but would not know how to do:
surfaceFormat.scanLineDirection()
1/2