Wrong date from images without exif data (only on mobile app)
The bug
Hello everyone, I encountered a problem with Immich: while uploading a photo from the mobile app if the file has no exif creation date the file is positioned in the timeline at the date in which is uploaded.
I read similar issues but this is somewhat different: the issue is only with images without valid exif data like whatsapp images or other jpgs and only in the mobile app. (The phone's gallery app can correctly displays the file capture date which i guess can only be retrieved correctly from the last modified date).
This issue is not present with the web version: if i load the same file, the date is correctly retrieved from the file metadata and the photo is displayed at the right date in the timeline.
This is the exif data of the photo i'm trying to upload:
| Property | Value |
|---|---|
| SourceFile | /storage/emulated/0/DCIM/Camera/Lumii_20240124_180233537.jpg |
| ExifToolVersion | 12.68 |
| FileName | Lumii_20240124_180233537.jpg |
| Directory | /storage/emulated/0/DCIM/Camera |
| FileSize | 4.1 MB |
| FileModifyDate | 2024:01:24 18:02:35+01:00 |
| FileAccessDate | 2024:03:27 14:00:52+01:00 |
| FileInodeChangeDate | 2024:03:28 02:12:43+01:00 |
| FilePermissions | -rw-rw---- |
| FileType | JPEG |
| FileTypeExtension | jpg |
| MIMEType | image/jpeg |
| JFIFVersion | 1.01 |
| ResolutionUnit | None |
| XResolution | 1 |
| YResolution | 1 |
| ImageWidth | 3024 |
| ImageHeight | 4032 |
| EncodingProcess | Baseline DCT Huffman coding |
| BitsPerSample | 8 |
| ColorComponents | 3 |
| YCbCrSubSampling | YCbCr4:4:4 (1 1) |
| ImageSize | 3024x4032 |
| Megapixels | 12.2 |
The only correct date is FileModifyDate and i guess this is used in some way in the web version but not from the mobile app?
Speculation: I read that immich uses many Exif dates in a 'priority order' wouldn't it make more sense to just get all the exif Date values and just pick the least recent date? Surely that would be the 'original' date if not manipulated by any other tool am I wrong?
The order i see is this:
/** look for a date from these tags (in order) */ const EXIF_DATE_TAGS: Array<keyof Tags> = [ 'SubSecDateTimeOriginal', 'DateTimeOriginal', 'SubSecCreateDate', 'CreationDate', 'CreateDate', 'SubSecMediaCreateDate', 'MediaCreateDate', 'DateTimeCreated', ];
But I don't see any 'FileModifyDate' used.
This is the image i'm trying to upload but I think that uploading it here will scramble the FileModifyDate metadata:
The OS that Immich Server is running on
Windows 11
Version of Immich Server
v1.101.0
Version of Immich Mobile App
v1.101.0 build.131
Platform with the issue
- [ ] Server
- [ ] Web
- [X] Mobile
Your docker-compose.yml content
Irrelevant
Your .env content
Irrelevant
Reproduction steps
1. Upload file without valid Exif dates from mobile app
2. See that is placed incorrectly in the timeline
3. Remove file
4. Load the same file from web interface
5. See that is placed correctly in the timeline
Additional information
No response