after editing update exif first, the last modified

This commit is contained in:
tibbi 2020-02-12 22:55:18 +01:00
parent 067caeeeeb
commit 5cc0a804b6

View file

@ -122,7 +122,7 @@ class NewEditActivity : SimpleActivity() {
toast(R.string.image_editing_failed) toast(R.string.image_editing_failed)
finish() finish()
} else { } 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 // first we rename it to the desired name, then move
val sourceString = Uri.decode(sourceImageUri.toString())?.toString() ?: "" val sourceString = Uri.decode(sourceImageUri.toString())?.toString() ?: ""
val source = if (sourceString.isEmpty() || sourceString.startsWith("content")) { val source = if (sourceString.isEmpty() || sourceString.startsWith("content")) {
@ -182,11 +182,6 @@ class NewEditActivity : SimpleActivity() {
private val editCopyMoveListener = object : CopyMoveListener { private val editCopyMoveListener = object : CopyMoveListener {
override fun copySucceeded(copyOnly: Boolean, copiedAll: Boolean, destinationPath: String) { 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 { try {
if (isNougatPlus()) { if (isNougatPlus()) {
val newExif = ExifInterface(destinationFilePath) val newExif = ExifInterface(destinationFilePath)
@ -195,6 +190,11 @@ class NewEditActivity : SimpleActivity() {
} catch (ignored: Exception) { } 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) val paths = arrayListOf(destinationFilePath)
rescanPaths(paths) { rescanPaths(paths) {
fixDateTaken(paths, false) fixDateTaken(paths, false)