From 5cc0a804b6ce17d8774e38fd4fc47c1a3e383a41 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 12 Feb 2020 22:55:18 +0100 Subject: [PATCH] after editing update exif first, the last modified --- .../gallery/pro/activities/NewEditActivity.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt index c7b625ae0..b3b8e4905 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/NewEditActivity.kt @@ -122,7 +122,7 @@ class NewEditActivity : SimpleActivity() { toast(R.string.image_editing_failed) finish() } else { - // the image is stored at the internal app storage first, for example /data/user/0/com.simplemobiletools.gallery.pro/files/editor/IMG_20191207_183023.jpg + // the image is stored at the internal app storage first, for example /data/user/0/com.simplemobiletools.gallery.pro/cache/editor/IMG_20191207_183023.jpg // first we rename it to the desired name, then move val sourceString = Uri.decode(sourceImageUri.toString())?.toString() ?: "" val source = if (sourceString.isEmpty() || sourceString.startsWith("content")) { @@ -182,11 +182,6 @@ class NewEditActivity : SimpleActivity() { private val editCopyMoveListener = object : CopyMoveListener { override fun copySucceeded(copyOnly: Boolean, copiedAll: Boolean, destinationPath: String) { - if (config.keepLastModified) { - // add 1 s to the last modified time to properly update the thumbnail - updateLastModified(destinationFilePath, sourceFileLastModified + 1000) - } - try { if (isNougatPlus()) { val newExif = ExifInterface(destinationFilePath) @@ -195,6 +190,11 @@ class NewEditActivity : SimpleActivity() { } catch (ignored: Exception) { } + if (config.keepLastModified) { + // add 1 s to the last modified time to properly update the thumbnail + updateLastModified(destinationFilePath, sourceFileLastModified + 1000) + } + val paths = arrayListOf(destinationFilePath) rescanPaths(paths) { fixDateTaken(paths, false)