Skip to content

Commit

Permalink
Don't attempt to rotate if orientation is undefined
Browse files Browse the repository at this point in the history
For detailed explanation, please refer to https://stackoverflow.com/a/28024859
  • Loading branch information
shobhitagarwal1612 committed Aug 24, 2024
1 parent 0dd6c94 commit 22889f0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ import com.google.android.ground.repository.UserMediaRepository
import com.google.android.ground.ui.datacollection.tasks.AbstractTaskViewModel
import com.google.android.ground.ui.util.BitmapUtil
import dagger.hilt.android.qualifiers.ApplicationContext
import java.io.IOException
import java.lang.UnsupportedOperationException
import javax.inject.Inject
import kotlinx.coroutines.flow.map
import timber.log.Timber
import java.io.IOException
import javax.inject.Inject

class PhotoTaskViewModel
@Inject
Expand Down Expand Up @@ -93,6 +92,7 @@ constructor(
*/
private fun getRotationDegrees(orientation: Int): Float =
when (orientation) {
ExifInterface.ORIENTATION_UNDEFINED,
ExifInterface.ORIENTATION_NORMAL -> 0f
ExifInterface.ORIENTATION_ROTATE_90 -> 90f
ExifInterface.ORIENTATION_ROTATE_180 -> 180f
Expand Down

0 comments on commit 22889f0

Please sign in to comment.