android / android/camera-samples
Wrong picture orientation on Samsung devices
- Dominant language
- Kotlin
- Stars
- 5.5k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
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
}
}
}
Contributor guide
Research direction
Start by reproducing the orientation issue on a Samsung device using the provided OrientationEventListener and imageCapture targetRotation logic. Compare the resulting picture orientation with OnePlus behavior; done means captured images have the correct orientation on Samsung without breaking the reported working behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100