Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong picture orientation on Samsung devices #544

Open
sargam01 opened this issue May 22, 2023 · 0 comments
Open

Wrong picture orientation on Samsung devices #544

sargam01 opened this issue May 22, 2023 · 0 comments

Comments

@sargam01
Copy link

Please follow the following instructions before filing a bug:
i have added the orientationEventListener for getting the rotated image bt it not worked in Samsung and worked on one plus
private val orientationEventListener by lazy {
object : OrientationEventListener(this) {
override fun onOrientationChanged(orientation: Int) {
if (orientation == ORIENTATION_UNKNOWN) {
return
}
val rotation = when (orientation) {
in 45 until 135 -> Surface.ROTATION_270
in 135 until 225 -> Surface.ROTATION_180
in 225 until 315 -> Surface.ROTATION_90
else -> Surface.ROTATION_0
}
imageCapture?.targetRotation = rotation
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant