catch IOException at setting photo exif data separately so the code continues

This commit is contained in:
tibbi 2018-01-14 12:06:26 +01:00
parent c3e8ce8894
commit 3152b545e9
1 changed files with 5 additions and 5 deletions

View File

@ -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<ByteArray, Void, String>() {
@ -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 {