mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-06-05 21:59:19 +02:00
try getting real filename from content uri at Edit Activity
This commit is contained in:
@ -188,6 +188,11 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
|||||||
} else if (saveUri.scheme == "content") {
|
} else if (saveUri.scheme == "content") {
|
||||||
var newPath = applicationContext.getRealPathFromURI(saveUri) ?: ""
|
var newPath = applicationContext.getRealPathFromURI(saveUri) ?: ""
|
||||||
var shouldAppendFilename = true
|
var shouldAppendFilename = true
|
||||||
|
if (newPath.isEmpty()) {
|
||||||
|
newPath = applicationContext.getFilenameFromContentUri(saveUri) ?: ""
|
||||||
|
shouldAppendFilename = false
|
||||||
|
}
|
||||||
|
|
||||||
if (newPath.isEmpty()) {
|
if (newPath.isEmpty()) {
|
||||||
newPath = "$internalStoragePath/${getCurrentFormattedDateTime()}.${saveUri.toString().getFilenameExtension()}"
|
newPath = "$internalStoragePath/${getCurrentFormattedDateTime()}.${saveUri.toString().getFilenameExtension()}"
|
||||||
shouldAppendFilename = false
|
shouldAppendFilename = false
|
||||||
|
Reference in New Issue
Block a user