Always do resize operation on background thread

This commit is contained in:
Naveen 2023-05-24 03:48:16 +05:30
parent 2919b36583
commit 388037f6b5
No known key found for this signature in database
GPG key ID: 0E155DAD31671DA3

View file

@ -823,6 +823,7 @@ fun BaseSimpleActivity.launchResizeImageDialog(path: String, callback: (() -> Un
} }
fun BaseSimpleActivity.resizeImage(path: String, size: Point, callback: (success: Boolean) -> Unit) { fun BaseSimpleActivity.resizeImage(path: String, size: Point, callback: (success: Boolean) -> Unit) {
ensureBackgroundThread {
var oldExif: ExifInterface? = null var oldExif: ExifInterface? = null
if (isNougatPlus()) { if (isNougatPlus()) {
val inputStream = contentResolver.openInputStream(Uri.fromFile(File(path))) val inputStream = contentResolver.openInputStream(Uri.fromFile(File(path)))
@ -852,6 +853,7 @@ fun BaseSimpleActivity.resizeImage(path: String, size: Point, callback: (success
callback(false) callback(false)
} }
} }
}
} }
fun BaseSimpleActivity.rescanPathsAndUpdateLastModified(paths: ArrayList<String>) { fun BaseSimpleActivity.rescanPathsAndUpdateLastModified(paths: ArrayList<String>) {