Skip to content

Commit 9865044

Browse files
authored
Merge pull request #16 from ionic-team/fix/gallery-duplicate-webpath
fix: use unique filename per image in gallery fallback path
2 parents 2cd0370 + 57a2107 commit 9865044

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
The changes documented here do not include those from the original repository.
88

9+
## [1.0.1]
10+
11+
### 2026-04-27
12+
13+
- Fix: gallery multiple selection returning duplicate `uri` and `webPath` on Android devices where the MediaStore `_data` column is unavailable. Each selected image now gets a unique cache filename via `UUID.randomUUID()`.
14+
915
## [1.0.0]
1016

1117
### 2026-04-10

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>io.ionic.libs</groupId>
88
<artifactId>ioncamera-android</artifactId>
9-
<version>1.0.0</version>
10-
</project>
9+
<version>1.0.1</version>
10+
</project>

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)