From 3152b545e96de85ef7a78b9f358d51bd4b57439d Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 14 Jan 2018 12:06:26 +0100 Subject: [PATCH] catch IOException at setting photo exif data separately so the code continues --- .../simplemobiletools/camera/helpers/PhotoProcessor.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 66b5749d..ff17f805 100644 --- a/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt +++ b/app/src/main/kotlin/com/simplemobiletools/camera/helpers/PhotoProcessor.kt @@ -15,10 +15,7 @@ import com.simplemobiletools.camera.extensions.config import com.simplemobiletools.camera.extensions.getOutputMediaFile import com.simplemobiletools.camera.extensions.getPreviewRotation import com.simplemobiletools.commons.extensions.* -import java.io.File -import java.io.FileNotFoundException -import java.io.FileOutputStream -import java.io.OutputStream +import java.io.* class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId: Int, val deviceOrientation: Int) : AsyncTask() { @@ -101,7 +98,10 @@ class PhotoProcessor(val activity: MainActivity, val uri: Uri?, val currCameraId tempExif.copyTo(fileExif) fileExif.setAttribute(ExifInterface.TAG_ORIENTATION, exifOrientation) - fileExif.saveAttributes() + try { + fileExif.saveAttributes() + } catch (e: IOException) { + } return photoFile.absolutePath } catch (e: FileNotFoundException) { } finally {