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

View file

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