Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exif date/time isn't parsed correctly #9331

Open
2 of 3 tasks
ygaeon opened this issue May 8, 2024 · 4 comments
Open
2 of 3 tasks

Exif date/time isn't parsed correctly #9331

ygaeon opened this issue May 8, 2024 · 4 comments

Comments

@ygaeon
Copy link

ygaeon commented May 8, 2024

The bug

(Note this might be related to / same as #4898)

We have two different models of phones,

  • Fairphone 4, CalyxOS, OpenCamera v1.52 (mine)
  • Samsung Galaxy Note 10, Samsung Android (?), Samsung Camera v? (wifey's)

Both cameras sync to Immich server but our photos are not in order and I started investigating.

My photos are saved with wrong date/timestamp.
I'm currently in UTC+2 (Stockholm/Europe).
Comparing EXIFs (exiftool 12.76):

Photos

Fairphone 4:

File Name                       : IMG_20240504_164142.jpg

File Modification Date/Time     : 2024:05:04 16:41:42+02:00
File Access Date/Time           : 2024:05:06 19:05:53+02:00 *
File Inode Change Date/Time     : 2024:05:06 19:06:02+02:00 *

Date/Time Original              : 2024:05:04 16:41:42
Create Date                     : 2024:05:04 16:41:42

Create Date                     : 2024:05:04 16:41:42.809319
Date/Time Original              : 2024:05:04 16:41:42.809319
Modify Date                     : 2024:05:04 16:41:42.809319

* <- when I syncthing'd it

This Date/Time is translated to

05/04/2024, 06:41 PM (18:41)
Africa/Blantyre (+02:00)

Wrong time, wrong timezone ...

Samsung Galaxy Note 10:

File Name                       : 20240504_153307.jpg

File Modification Date/Time     : 2024:05:04 15:33:09+02:00
File Access Date/Time           : 2024:05:04 15:33:09+02:00
File Inode Change Date/Time     : 2024:05:06 20:02:35+02:00

Date/Time Original              : 2024:05:04 15:33:08
Create Date                     : 2024:05:04 15:33:08

Create Date <-- SGN10 doesn't have this at this pos
Date/Time Original              : 2024:05:04 15:33:08+02:00
Modify Date                     : 2024:05:04 15:33:08+02:00

This Date/Time is translated to

05/04/2024, 03:33 PM (15:33)
Africa/Blantyre (+02:00)

Correct time, wrong timezone ...

Videos

Fairphone 4:

File Name                       : VID_20240504_164249.mp4

File Modification Date/Time     : 2024:05:04 16:44:35+02:00
File Access Date/Time           : 2024:05:06 19:06:24+02:00 *
File Inode Change Date/Time     : 2024:05:06 19:06:34+02:00 *

Create Date                     : 2024:05:04 14:44:35
Modify Date                     : 2024:05:04 14:44:35

Track Create Date               : 2024:05:04 14:44:35
Track Modify Date               : 2024:05:04 14:44:35

Media Create Date               : 2024:05:04 14:44:35
Media Modify Date               : 2024:05:04 14:44:35

* <- when I syncthing'd it

This Date/Time is translated to

05/04/2024, 02:44 PM (14:44)
Africa/Abidjan (+00:00)

Which kind of translates to "correct" even if the correct should be "05/04/2024, 04:44 PM (16:44), Europe/Stockholm (+02:00)"

Samsung Galaxy Note 10:

File Name                       : 20240504_154055.mp4

File Modification Date/Time     : 2024:05:04 15:41:04+02:00
File Access Date/Time           : 2024:05:04 15:41:04+02:00
File Inode Change Date/Time     : 2024:05:06 20:02:52+02:00

Create Date                     : 2024:05:04 13:41:04
Modify Date                     : 2024:05:04 13:41:04

Track Create Date               : 2024:05:04 13:41:04
Track Modify Date               : 2024:05:04 13:41:04

Media Create Date               : 2024:05:04 13:41:04
Media Modify Date               : 2024:05:04 13:41:04

This Date/Time is translated to

05/04/2024, 03:41 PM (15:41)
Africa/Blantyre (+02:00)

Correct time, wrong timezone ...

From https://web.archive.org/web/20180921145139if_/http://www.cipa.jp:80/std/documents/e/DC-010-2017_E.pdf one can read:

  • DateTimeOriginal, DateTimeDigitized - The date and time when the image was stored as digital data (no time zone in Exif), stored in ISO 8601 format, not in the original Exif format. This property includes the value for the Exif SubSecTimeDigitized attribute.

From https://en.wikipedia.org/wiki/ISO_8601 on can read:

  • Time zones in ISO 8601 are represented as local time (with the location unspecified), as UTC, or as an offset from UTC. Time zone designators: <time>Z <time>±hh:mm <time>±hhmm <time>±hh
  • If no UTC relation information is given with a time representation, the time is assumed to be in local time.

Now, this is clearly not what's happening in Fairphone 4 case above:

  • "2024:05:04 16:41:42.809319" is being translated into "05/04/2024, 06:41 PM (18:41) Africa/Blantyre (+02:00)".
  • The date/time is already in UTC+2 ("local time").

Something is clearly not being parsed correctly somewhere .. and I have thousands of photos that are sorted wrongly in the archive now ..

Please advice ..

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.99.0

Version of Immich Mobile App

1.100.0 build.130

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

N/A .. running podman


podman pod create --name pod-immich --hostname immich --publish 2283:3001

podman run -d --pod pod-immich --name immich_redis redis:6.2-alpine

podman run -d --pod pod-immich --name immich_postgres --env-file $DP/immich.env --volume $DP/postgres:/var/lib/postgresql/data tensorchord/pgvecto-rs:pg14-v0.2.0

podman run -d --pod pod-immich --name immich_machine_learning --env-file $DP/immich.env --volume $DP/model-cache:/cache immich-machine-learning:v1.99.0

podman run -d --pod pod-immich --name immich_server --env-file $DP/immich.env --volume $DP/upload:/usr/src/app/upload --volume /etc/localtime:/etc/localtime:ro immich-server:v1.99.0 start.sh immich

podman run -d --pod pod-immich --name immich_microservices --env-file $DP/immich.env --volume $DP/upload:/usr/src/app/upload --volume /etc/localtime:/etc/localtime:ro immich-server:v1.99.0 start.sh microservices

Your .env content

# General
TZ="Europe/Stockholm"

# Database
DB_HOSTNAME=immich_postgres
DB_USERNAME=immich
DB_PASSWORD=xxxxx

DB_DATABASE=immich
DB_DATABASE_NAME=immich

# Postgres
POSTGRES_USER=immich
POSTGRES_PASSWORD=xxxxx
POSTGRES_DB=immich

# Redis
REDIS_HOSTNAME=immich_redis

Reproduction steps

N/A

Relevant log output

No response

Additional information

No response

@scrampker
Copy link

I'm seeing similar problems on my GrapheneOS phone as well. Seems to impact videos and photos differently. Sometimes tagged with local time zone, other times, UTC. -- but odd, because it's not just the wrong time zone, it can be the wrong day in UTC. IE videos I took last night are saying they're in the future -- for tonight.

@fmartingr
Copy link

I see similar issues on my end. In my case I my pictures where saved into iCloud Photos from a DJI Osmo 3, and when the app imported them into Immich the datetime was wrong by 2 hours.

I removed all pictures and tried to import them manually via
the web interface, same result.

Attaching one of the pictures that has that issue.

DJI_20240511164405_0094_D.JPG

@scrampker
Copy link

scrampker commented May 12, 2024 via email

@ygaeon
Copy link
Author

ygaeon commented May 20, 2024

Anyone from the project that can comment back?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants