mirror of
https://github.com/SimpleMobileTools/Simple-Camera.git
synced 2025-06-27 09:02:59 +02:00
fix the rotation of images captured with Camera2 api
This commit is contained in:
@ -35,3 +35,10 @@ const val STATE_PICTURE_TAKEN = 2
|
||||
const val STATE_WAITING_LOCK = 3
|
||||
const val STATE_WAITING_PRECAPTURE = 4
|
||||
const val STATE_WAITING_NON_PRECAPTURE = 5
|
||||
|
||||
fun compensateDeviceRotation(orientation: Int, isUsingFrontCamera: Boolean) = when {
|
||||
orientation == ORIENT_LANDSCAPE_LEFT -> 270
|
||||
orientation == ORIENT_LANDSCAPE_RIGHT -> 90
|
||||
isUsingFrontCamera -> 180
|
||||
else -> 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user