immich-app / immich

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

Wrong age of people on some photos #7178

Open jenda69 opened 4 months ago

jenda69 commented 4 months ago

The bug

I have people on some old photos. I just filled their birthdate and noticed that if I open a person, scroll to some old photos e.g. in 2011 and open them, some of them show the age correctly (20 years) but some show age incorrectly (often 32 which would be last year, if correct).

The OS that Immich Server is running on

Raspbian Bookworm

Version of Immich Server

1.94.1

Version of Immich Mobile App

N/A

Platform with the issue

Your docker-compose.yml content

version: "3.8"

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ./custom.css:/usr/src/app/www/custom.css
      - ${UPLOAD_LOCATION_SLOW}/upload:/usr/src/app/upload
      - ${UPLOAD_LOCATION_FAST}/upload/thumbs:/usr/src/app/upload/thumbs
      - ${UPLOAD_LOCATION_FAST}/upload/upload:/usr/src/app/upload/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH_SLOW}/jenda/fotky:/usr/src/app/external/jenda:ro
      - ${UPLOAD_LOCATION_SLOW}/upload/library/hanka:/storage/immich/upload/library/hanka:ro
      - ${EXTERNAL_PATH_SLOW}/hanka/fotky:/usr/src/app/external/hanka:ro
    env_file:
      - .env
    ports:
      - 2283: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_SLOW}/upload:/usr/src/app/upload
      - ${UPLOAD_LOCATION_FAST}/upload/thumbs:/usr/src/app/upload/thumbs
      - ${UPLOAD_LOCATION_FAST}/upload/upload:/usr/src/app/upload/upload
      - /etc/localtime:/etc/localtime:ro
      - ${EXTERNAL_PATH_SLOW}/jenda/fotky:/usr/src/app/external/jenda:ro
      - ${UPLOAD_LOCATION_SLOW}/upload/library/hanka:/storage/immich/upload/library/hanka:ro
      - ${EXTERNAL_PATH_SLOW}/hanka/fotky:/usr/src/app/external/hanka:ro
    env_file:
      - .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:
      - ${UPLOAD_LOCATION_SLOW}/model-cache:/cache
    env_file:
      - .env
    restart: always

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

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

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION_FAST=/storage-fast/immich
UPLOAD_LOCATION_SLOW=/storage/immich
EXTERNAL_PATH_FAST=/storage-fast/user
EXTERNAL_PATH_SLOW=/storage/user

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=IwontPostMyPasswordHere

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Fill in person's age
2. Open person's photo time line
3. Scroll down
4. Open some old photos

Additional information

I looked into the DB and noticed that the photos with a wrong age have the "localDateTime" column correct when the photo was taken, but the other date columns (like updatedAt, createdAt, fileCreatedAt, fileModifiedAt) are from current year or last year (when I imported my whole library do DigiKam and had to fix a bunch of things to show the photos correctly in its timeline).

The ones with a correct age have localDateTime, fileCreatedAt a fileModifiedAt correct when the photo was taken.

So my guess is Immich gets dates of photos in timeline and in Info panel from "localDateTime" which is correct for all my photos but calculates the age from some other column which might not be correct date when photo was taken.

aviv926 commented 4 months ago

According to what you wrote in additional information, it may be related to https://github.com/immich-app/immich/issues/6799