Skip to content

Commit 6b0ade4

Browse files
fix: editURIPicture using file:// URI (#5)
1 parent 3312be0 commit 6b0ade4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/kotlin/io/ionic/libs/ioncameralib/manager/IONCAMREditManager.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,15 @@ class IONCAMREditManager(
9595
launcher: ActivityResultLauncher<Intent>,
9696
onError: (IONCAMRError) -> Unit
9797
) {
98-
val imageFile = File(pictureFilePath)
98+
val correctedFilePath =
99+
fileHelper.stripFileProtocol(pictureFilePath) ?: pictureFilePath
100+
val imageFile = File(correctedFilePath)
99101
if (!fileHelper.fileExists(imageFile)) {
100102
onError(IONCAMRError.FILE_DOES_NOT_EXIST_ERROR)
101103
return
102104
}
103105
val drawable: Drawable? = try {
104-
Drawable.createFromPath(pictureFilePath)
106+
Drawable.createFromPath(correctedFilePath)
105107
} catch (ex: Exception) {
106108
ex.printStackTrace()
107109
null

0 commit comments

Comments
 (0)