catch exceptions thrown at saving image rotation
This commit is contained in:
parent
d8c17b8a80
commit
6db0adced8
1 changed files with 11 additions and 6 deletions
|
@ -581,12 +581,17 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.N)
|
@TargetApi(Build.VERSION_CODES.N)
|
||||||
private fun tryRotateByExif(path: String): Boolean {
|
private fun tryRotateByExif(path: String): Boolean {
|
||||||
return if (saveImageRotation(path, mRotationDegrees)) {
|
return try {
|
||||||
mRotationDegrees = 0
|
if (saveImageRotation(path, mRotationDegrees)) {
|
||||||
invalidateOptionsMenu()
|
mRotationDegrees = 0
|
||||||
toast(R.string.file_saved)
|
invalidateOptionsMenu()
|
||||||
true
|
toast(R.string.file_saved)
|
||||||
} else {
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
showErrorToast(e)
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue