mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
close the inputStream after using at the editor activity
This commit is contained in:
parent
a909e70794
commit
555c18ae4f
1 changed files with 4 additions and 1 deletions
|
@ -593,14 +593,17 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||||
bitmap.compress(file.absolutePath.getCompressionFormat(), 90, out)
|
bitmap.compress(file.absolutePath.getCompressionFormat(), 90, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var inputStream: InputStream? = null
|
||||||
try {
|
try {
|
||||||
if (isNougatPlus()) {
|
if (isNougatPlus()) {
|
||||||
val inputStream = contentResolver.openInputStream(uri)
|
inputStream = contentResolver.openInputStream(uri)
|
||||||
val oldExif = ExifInterface(inputStream)
|
val oldExif = ExifInterface(inputStream)
|
||||||
val newExif = ExifInterface(file.absolutePath)
|
val newExif = ExifInterface(file.absolutePath)
|
||||||
oldExif.copyTo(newExif, false)
|
oldExif.copyTo(newExif, false)
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
} finally {
|
||||||
|
inputStream?.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
setResult(Activity.RESULT_OK, intent)
|
setResult(Activity.RESULT_OK, intent)
|
||||||
|
|
Loading…
Reference in a new issue