From c0c7752f797027b6418ba81d9a116af5eeef5c5c Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 14 Apr 2018 21:31:31 +0200 Subject: [PATCH] try getting real filename from content uri at Edit Activity --- .../com/simplemobiletools/gallery/activities/EditActivity.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt index 6f6338795..74e8662cb 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/EditActivity.kt @@ -188,6 +188,11 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener } else if (saveUri.scheme == "content") { var newPath = applicationContext.getRealPathFromURI(saveUri) ?: "" var shouldAppendFilename = true + if (newPath.isEmpty()) { + newPath = applicationContext.getFilenameFromContentUri(saveUri) ?: "" + shouldAppendFilename = false + } + if (newPath.isEmpty()) { newPath = "$internalStoragePath/${getCurrentFormattedDateTime()}.${saveUri.toString().getFilenameExtension()}" shouldAppendFilename = false