From 987f333c5cb34ad46ae8124a32ad3cf84ae760ca Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 20 May 2017 12:59:20 +0200 Subject: [PATCH] if a filename is empty, try getting it from the path --- .../simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt index 577a62dcb..f085448e9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/asynctasks/GetMediaAsynctask.kt @@ -78,6 +78,9 @@ class GetMediaAsynctask(val context: Context, val mPath: String, val isPickVideo } filename = cur.getStringValue(MediaStore.Images.Media.DISPLAY_NAME) ?: "" + if (filename.isEmpty()) + filename = path.getFilenameFromPath() + val isImage = filename.isImageFast() || filename.isGif() val isVideo = if (isImage) false else filename.isVideoFast()