Wrong date on some older photos?

Hello, I have some older photos that have file created and modified dates wrong, but the EXIF is correct. It has the EXIF date taken with the correct dates. However, Immich is still using the created date. I updated to 1.81 and refreshed the metadata for those items and the problem persisted. Here is an example photo directly as it saved on my NAS: https://gofile.me/6XtEp/5yrvho0Ct Thank you!
22 Replies
Pancake
PancakeOP2y ago
Should I post this as an issue on github?
harababurel
harababurel2y ago
for what it's worth, I tried replicating your issue and got the same result
harababurel
harababurel2y ago
tried comparing your photo (left) with one of mine (right) which has correct EXIF data on immich
No description
harababurel
harababurel2y ago
Date/Time Original looks correct but immich doesn't use it for some reason ah wait, maybe it doesn't look right 2003:06:05:18:00:00 separates the date and time with a colon instead of a space
harababurel
harababurel2y ago
fixed it:
No description
harababurel
harababurel2y ago
after running exiftool -DateTimeOriginal="2003:06:05 18:00:00" "fotos 013.jpg"
harababurel
harababurel2y ago
btw it seems the metadata extraction job tries to parse datetime fields in this order and chooses the first valid existing one
GitHub
immich/server/src/domain/metadata/metadata.service.ts at 7b4e36e990...
Self-hosted photo and video backup solution directly from your mobile phone. - immich-app/immich
harababurel
harababurel2y ago
(lines 326-337, don't know how to permalink to that section) so on your file one of the file specific timestamps ends up being used
File Modification Date/Time : 2023:10:05 09:17:01+02:00
File Access Date/Time : 2023:10:05 09:17:35+02:00
File Inode Change Date/Time : 2023:10:05 09:17:02+02:00
Date/Time Original : 2003:06:05:18:00:00
File Modification Date/Time : 2023:10:05 09:17:01+02:00
File Access Date/Time : 2023:10:05 09:17:35+02:00
File Inode Change Date/Time : 2023:10:05 09:17:02+02:00
Date/Time Original : 2003:06:05:18:00:00
Pancake
PancakeOP2y ago
@harababurel thank you, do you think that's a bug?
harababurel
harababurel2y ago
probably not, I suspect the EXIF data is just wrong but I'm not familiar with the exact spec let me take a look
Pancake
PancakeOP2y ago
I have lots of photos with that problem, mostly old ones. I could try to find a way of correcting the exif maybe?
harababurel
harababurel2y ago
all examples in https://en.wikipedia.org/wiki/Exif#Time_Tags use a space as separator
Pancake
PancakeOP2y ago
hmmm I wonder if I'm the only one with photos like this
harababurel
harababurel2y ago
$ exiftool -if '$DateTimeOriginal =~ /:\d{2}:\d{2}:\d{2}$/' -filename . maybe try this, should detect which files have the same problem
Pancake
PancakeOP2y ago
interesting, let me set this up
harababurel
harababurel2y ago
or better yet exiftool -if '$DateTimeOriginal =~ /:\d{2}:\d{2}:\d{2}/' -filename . since some files might have a timezone at the end of that field
Pancake
PancakeOP2y ago
trying to run it with the windows executable, not sure about the syntax on powershell it worked
harababurel
harababurel2y ago
exiftool -if "$DateTimeOriginal -match ':\d{2}:\d{2}:\d{2}'" -filename . should work in powershell (this is all GPT generated so take it with a grain of salt)
Pancake
PancakeOP2y ago
I have some other files that still have the date not correct in immich, but that filter doesn't get them do you mind having a look at one?
harababurel
harababurel2y ago
sure
Pancake
PancakeOP2y ago
No description
Pancake
PancakeOP2y ago
oh I think this one doesn't even have any exif

Did you find this page helpful?