catch and show exceptions thrown at rotating saved image

This commit is contained in:
tibbi 2018-04-08 11:13:31 +02:00
parent 3f6e541bba
commit ad1a721f8f
1 changed files with 8 additions and 4 deletions

View File

@ -97,12 +97,16 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId
}
}
val fileExif = ExifInterface(path)
image.compress(Bitmap.CompressFormat.JPEG, activity.config.photoQuality, fos)
activity.saveImageRotation(path, totalRotation)
try {
image.compress(Bitmap.CompressFormat.JPEG, activity.config.photoQuality, fos)
activity.saveImageRotation(path, totalRotation)
} catch (e: Exception) {
activity.showErrorToast(e)
return ""
}
if (activity.config.savePhotoMetadata) {
val fileExif = ExifInterface(path)
tempExif.copyTo(fileExif)
}