immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
38.89k stars 1.84k forks source link

Incorrect Date due to Sony Camera not adding offset time? #6589

Open HinataKato opened 5 months ago

HinataKato commented 5 months ago

The bug

I uploaded a jpeg taken by my Sony Alpha 7 First gen Im in UTC+8, the time showed in my gallery app are 2023:12:30 23:03 But on immich, the time is 2023:12:31 7:03 (+8)

I checked the exif by using exiftool, looks like Sony didn't add offset time, caused immich to confuse?

Here's the output of the camera

Exif Version                    : 0230
Date/Time Original              : 2023:12:30 23:04:21
Create Date                     : 2023:12:30 23:04:21
Components Configuration        : Y, Cb, Cr, -

Here's my phone's output (using Google Camera)

Exif Version                    : 0232
Date/Time Original              : 2024:01:23 06:39:15
Create Date                     : 2024:01:23 06:39:15
Offset Time                     : +08:00
Offset Time Original            : +08:00
Offset Time Digitized           : +08:00
Components Configuration        : Y, Cb, Cr, -

The only place that I can see the time offset info are File (sth) Date/Time (Date Time+08:00)

Is there any good way to solve that?

The OS that Immich Server is running on

TrueNAS Scale 22.12.1 (but docker inside Debian 11 jaill)

Version of Immich Server

v1.93.3

Version of Immich Mobile App

v1.93.2

Platform with the issue

Your docker-compose.yml content

version: "3.8"

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /mnt/Hitachi/Files/Photos:/mnt/Hitachi/Files/Photos
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    ports:
      - *:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /mnt/Hitachi/Files/Photos:/mnt/Hitachi/Files/Photos
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - stack.env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    environment:
      - HTTP_PROXY=http://192.168.1.1:7890/
      - HTTPS_PROXY=http://192.168.1.1:7890/
      - ALL_PROXY=http://192.168.1.1:7890/
    env_file:
      - stack.env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
    env_file:
      - stack.env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:

Your .env content

UPLOAD_LOCATION=/mnt/Hitachi/docker-conf/immich/cache
IMMICH_VERSION=release
DB_PASSWORD=*
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Taken a photo with the camera with timezone offset
2. Upload to immich
3. Date didn't match up

Additional information

No response

DeltaTango69 commented 5 months ago

The same is described in

6189

3863

6674

The very important thing of the app is that the timeline is correct. And it would be a shame not to be able to use the program because I like it best of all the alternatives so far. Thanks at this point for the development of the program!

HinataKato commented 5 months ago

And it would be a shame not to be able to use the program because I like it best of all the alternatives so far.

Same here, the UI are just amazing. But this one teeny tiny issue bothers me: it would be nice to just says "local time" for this kinds of photos, like photoprism does Screenshot_20240129-163200_Chrome

DeltaTango69 commented 5 months ago

Photoprism, Plex, other software - everywhere it is working with the datetimeoriginal as local time. This are exif standards. The timeline is correct using this programms. No idea why Immich does it differently? The result is now a timeline that is not correct.

akoen commented 4 months ago

@HinataKato and @DeltaTango69 I started a Discord focus discussion about this here: https://discord.com/channels/979116623879368755/1206309678578016277/1206309678578016277, because I agree with your points. Your input would be super appreciated.

fwsmit commented 3 weeks ago

I'm working on resolving the issues with timezone detection for DSLR pictures. At least on my Sony A7 first gen it's possible to infer the timezone from the exif metadata. To fix this issue for other camera's as well, I need some example pictures.

To submit example pictures, please follow the following steps:

Upload both pictures to the following github issue: https://github.com/photostructure/exiftool-vendored.js/issues/187. Please document clearly which image is which timezone and which camera you used.