diff --git a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt index 7863a4f2..13f61f56 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt @@ -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) }