properly retrieve old last_modified at rotating files by exif

This commit is contained in:
tibbi 2019-01-13 20:19:54 +01:00
parent 57e7fb03d1
commit 247b41445d
1 changed files with 6 additions and 0 deletions

View File

@ -665,7 +665,13 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
@TargetApi(Build.VERSION_CODES.N) @TargetApi(Build.VERSION_CODES.N)
private fun tryRotateByExif(path: String): Boolean { private fun tryRotateByExif(path: String): Boolean {
return try { return try {
val file = File(path)
val oldLastModified = file.lastModified()
if (saveImageRotation(path, mRotationDegrees)) { if (saveImageRotation(path, mRotationDegrees)) {
if (config.keepLastModified) {
file.setLastModified(oldLastModified)
updateLastModified(path, oldLastModified)
}
mRotationDegrees = 0 mRotationDegrees = 0
invalidateOptionsMenu() invalidateOptionsMenu()
toast(R.string.file_saved) toast(R.string.file_saved)