The CameraDescription is returning a sensorOrientation of 90 while the DeviceOrientation is returning portrait.
My Google Pixel 7 is in portrait mode.
When i'm using the CameraPreview with the google_mlkit_barcode_scanning: ^0.12.0 the camera surface preview is rotated and streched while the displayed barcode is normal.
I found that in the CameraPreview there is this code that use a RotatedBox if the DeviceOrientation is in landscape or so:
The CameraDescription is returning a sensorOrientation of 90 while the DeviceOrientation is returning portrait.
My Google Pixel 7 is in portrait mode. When i'm using the CameraPreview with the
google_mlkit_barcode_scanning: ^0.12.0
the camera surface preview is rotated and streched while the displayed barcode is normal.I found that in the CameraPreview there is this code that use a RotatedBox if the DeviceOrientation is in landscape or so:
I assume the CameraPreview internally use the camera.sensorOrientation to display the surface view.
As a result my camera surface view is completely stretched:
But if i change the camera preview to use the camera.sensorOrientation, everything works fine:
So why is there a difference between the device orientation and the sensor orientation ?
I have no problem with the native camera app of my phone.
While using camera flutter libs, i have to bake orientation of captured image if i want them to be in the right orientation.
Platform (please complete the following information):
Other code for context:
Thanks !