diff --git a/README.md b/README.md
index 1ef62bd..f2dd2c7 100644
--- a/README.md
+++ b/README.md
@@ -117,6 +117,7 @@ made in uploading them to server without the need to ask use for a single permis
| 1.0.3 | Fix bug : LifecycleOwner Activity is attempting to register while current state is RESUMED. |
| 1.0.4 | Enhancement : Avoid possible activity reference leaking.
Feature : Implement camera image picker. |
| 1.0.5 | Feature : Support fragments.
Feature : Implement file picking from initial directory.
fix : obsolete app icon unintended overriding. |
+| 1.0.6 | Enhancement : Add file extension to video files and images picked from camera. |
diff --git a/filepicker/build.gradle b/filepicker/build.gradle
index acadfc7..a6329a8 100644
--- a/filepicker/build.gradle
+++ b/filepicker/build.gradle
@@ -44,7 +44,7 @@ afterEvaluate {
groupId = 'com.github.atwa'
artifactId = 'filepicker'
- version = '1.0.5'
+ version = '1.0.6'
}
}
repositories {
diff --git a/filepicker/src/main/java/com/atwa/filepicker/decoder/UriDecoder.kt b/filepicker/src/main/java/com/atwa/filepicker/decoder/UriDecoder.kt
index d002b23..bd10a6d 100644
--- a/filepicker/src/main/java/com/atwa/filepicker/decoder/UriDecoder.kt
+++ b/filepicker/src/main/java/com/atwa/filepicker/decoder/UriDecoder.kt
@@ -64,7 +64,8 @@ internal class UriDecoder(
private fun saveImageToFile(bitmap: Bitmap): ImageMeta? {
var byteStream: ByteArrayInputStream? = null
return try {
- val fileName = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()).toString()
+ val fileName =
+ TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()).toString().plus(".jpg")
val imageFile = File(context?.cacheDir, fileName)
val size = imageFile.length().getFileSize()
@@ -112,7 +113,8 @@ internal class UriDecoder(
return try {
uri?.let { uri ->
inputStream = contentResolver?.openInputStream(uri)
- val fileName = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()).toString()
+ val fileName =
+ TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis()).toString().plus(".mp4")
val videoFile = File(context?.cacheDir, fileName)
val outputStream = FileOutputStream(videoFile)
inputStream?.let { streamer.copyFile(it, outputStream) }