FossifyOrg / Gallery

Browse your memories without any interruptions with this photo and video gallery
https://www.fossify.org
GNU General Public License v3.0
1.6k stars 53 forks source link

Moving photos changes the "create date" and "change date" #140

Open d-mal opened 7 months ago

d-mal commented 7 months ago

Checklist

Affected app version

1.1.1

Affected Android/Custom ROM version

Android 11 patch 2023-07-01

Affected device model

Samsung Galaxy xcover 4s

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

  1. Select a photo that was taken a while ago
  2. long press, choose "move to..." in the menu, and choose another folder
  3. look at the file details at the new place with a file manager app like total commander (alternatively copy the file to a PC to inspect it)

Expected behavior

I would expect that the file date remains the same.

Actual behavior

Instead, the file will have the current date.

Screenshots/Screen recordings

Screenshot_20240219-221508_Gallery

This is from the "i"nfo menu of FossifyGallery. You can see the "capture" date which is still the same as in the filename, and the change date which is today.

Screenshot_20240219-221314_Total Commander

This is from Totalcommander.

Additional information

This happens even if the "keep old change date" option under file operations is active. But it has the same result if that option is not checked.

Note: this does not affect the sort order in the gallery app. The sort order seems to look at the original creation / capture date, which is saved in the exif info (and in the filename in the case of my camera app).

The problem will show when an app uses the "change" date to sort files. Then the photos that have been moved will look newer than they actually are. Example: image This is TotalCommander on Windows looking at the phone, file sorting uses the "change date".

image These are the file details. You can see both creation and change date are now the new date.

Aga-C commented 7 months ago

I can't reproduce it on Android 10 (Xiaomi) and Android 13 (OnePlus), so it seems to be device specific. If anybody else also encounters this bug, please write your device model and OS version.

d-mal commented 7 months ago

Thanks for the quick check! Interesting -- hopefully someone with Android 11 can cross check this, to see if it's related to the Android version or if it's down to the device.

CurbedLarry commented 7 months ago

From memory Google fixed this in Android 9, moved files shouldn't get new dates.

Can't recreate on a Samsung S10e with Android 12. Copied a file to another folder and SD, moved back, kept original dates.

J4CKED commented 7 months ago

In Android 12, it's fine. I remember that this problem occurred in old (previous) versions of the Simple Gallery app.

older-pack commented 7 months ago

Doesn't happen on Motorola/ Android 11 (1 Feb 2022) /Gallery 1.1.1/ F-Droid

inson1 commented 7 months ago

@J4CKED Do know some bug report about this?

inson1 commented 7 months ago

There are lots of bug reports about sorting by creation date, but that is not it

this is interesting, but also not it https://github.com/SimpleMobileTools/Simple-Gallery/issues/909

J4CKED commented 7 months ago

@J4CKED Do know some bug report about this?

https://github.com/SimpleMobileTools/Simple-Gallery/issues/2321

onegladius commented 7 months ago

Oh, this also happens to me on my android 10 motorola. I thought it's because i store all my photos on the sd card but that doesn't seem the case?

Also lowkey the seed of doubt was already planted in my mind because on my old android 12 samsung this didn't happen and i used the same sd card to store photos so this must mean it's device specific.

For example, it just happend that earlier today i moved all the photos and videos i have taken in 2022 to a separate folder , because I like to organize them by years, and all the photos/videos that were NOT made with my old phone show that they have been created today. Here is a screenshot.

However for the ones that where created before I switched to android 10 show the correct date ( here, a screenshot ). For clarification, before I moved the files the correct date was shown.

SarenT commented 7 months ago

I am copying my comment from SMT:

I wonder if this helps, but I had this issue with files copied during back up (before fresh lineage OS install). EXIF dates were correct but file system (ls -lah) showed the date of restore (copying from PC to phone). File names also include the time stamp (IMG_...). I thought that fixing last modified date on time stamps would fix it. So I wrote this command in adb shell to use file names as reference:

for file in $(find * -type f -name 'IMG*'); do timestamp=$(echo "$file" | sed 's/IMG_\([0-9]\{8\}_[0-9]\{6\}\)\.jpg/\1/'); formatted_timestamp=$(date -d "${timestamp:4:2}${timestamp:6:2}${timestamp:9:2}${timestamp:11:2}${timestamp:0:4}.${timestamp:13:2}"); touch -t "$formatted_timestamp" "$file"; done

It successfully corrected the last modified date in the folder (checked with: ls -lah). However, the app still shows the wrong last modified date. Clearing cache and storage did not fix it. I also cleared cache and storage in the default gallery app (LOS), which now shows the correct date/timeline. Simple Gallery is somehow still stuck at the wrong dates/timeline. I wonder, where it stores or gets from these values?

One little update: Same also applies for Simple File Manager, which displays wrong last modified dates.