Skip to content

Commit 12c70dd

Browse files
committed
fix: use unique filename per image in gallery fallback path
1 parent 2cd0370 commit 12c70dd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/kotlin/io/ionic/libs/ioncameralib/helper/IONCAMRFileHelper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ class IONCAMRFileHelper: IONCAMRFileHelperInterface {
566566
var read: Int
567567
val buffer = ByteArray(8 * 1024)
568568
val extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType) ?: "dat"
569-
val targetFile = createCaptureFile(context, "file.${extension}")
569+
val targetFile = createCaptureFile(context, "${UUID.randomUUID()}.${extension}")
570570
val outputStream: OutputStream = FileOutputStream(targetFile)
571571
while (inputStream.read(buffer).also { read = it } != -1) {
572572
outputStream.write(buffer, 0, read)
@@ -579,4 +579,4 @@ class IONCAMRFileHelper: IONCAMRFileHelperInterface {
579579
}
580580
return targetFile
581581
}
582-
}
582+
}

0 commit comments

Comments
 (0)