[BUG] Thumbnails not generated for tagged photos #1297

Closed
opened 2026-02-05 01:11:44 +03:00 by OVERLORD · 12 comments
Owner

Originally created by @peter-sc on GitHub (Sep 1, 2023).

The bug

I have assigned tags to photos in Digikam 8.1 (metadata are stored in photos and not sidecard files) and imported them to Immich.
For the tagged photos, thumbnails are not generated and error is displayed:

[Nest] 7  - 09/01/2023, 2:57:23 PM   ERROR [JobService] Unable to run job handler: Error: Input file has corrupt header: upload/library/admin/2022/07/2022-07-22_114344.HEIC: bad seek to 1868562

[Nest] 7  - 09/01/2023, 2:57:23 PM   ERROR [JobService] Error: Input file has corrupt header: upload/library/admin/2022/07/2022-07-22_114344.HEIC: bad seek to 1868562

[Nest] 7  - 09/01/2023, 2:57:23 PM   ERROR [JobService] Object:
{
  "id": "89fa195c-d5d0-4b70-aa95-a40cd6a8d640",
  "source": "upload"
}
immich=# SELECT * FROM assets WHERE id='89fa195c-d5d0-4b70-aa95-a40cd6a8d640';
-[ RECORD 1 ]----+----------------------------------------------------
id               | 89fa195c-d5d0-4b70-aa95-a40cd6a8d640
deviceAssetId    | web-2022-07-22_114344-test.HEIC-1693571698268
ownerId          | d9b4299f-98c9-4048-8479-1f99041574d6
deviceId         | WEB
type             | IMAGE
originalPath     | upload/library/admin/2022/07/2022-07-22_114344.HEIC
resizePath       |
fileCreatedAt    | 2022-07-22 11:43:44+02
fileModifiedAt   | 2023-09-01 14:34:58.268+02
isFavorite       | f
duration         | 0:00:00.000000
webpPath         |
encodedVideoPath |
checksum         | \x1633a1833ada0c31fc680ea3014daf0e1b60eec2
isVisible        | t
livePhotoVideoId |
updatedAt        | 2023-09-01 14:57:23.703305+02
createdAt        | 2023-09-01 14:57:20.593109+02
isArchived       | f
originalFileName | 2022-07-22_114344-test
sidecarPath      |
isReadOnly       | f
thumbhash        |

These details are extracted from photo and displayed in web:

image

the photo:
2022-07-22_114344-test.zip

The OS that Immich Server is running on

Debian 12

Version of Immich Server

v1.76.1

Version of Immich Mobile App

v1.76.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    user: "${PUID}:${PGID}"
    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
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    user: "${PUID}:${PGID}"
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - ${MICRO_LOCATION}:/usr/src/app/.reverse-geocoding-dump
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: always

#  immich-machine-learning:
#    container_name: immich_machine_learning
#    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
#    user: "${PUID}:${PGID}"
#    volumes:
#      - model-cache:/cache
#    env_file:
#      - .env
#    restart: always

  immich-web:
#    user: "${PUID}:${PGID}"
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    restart: always

  typesense:
#    user: "${PUID}:${PGID}"
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - tsdata:/data
    restart: always

  redis:
#    user: "${PUID}:${PGID}"
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3
    restart: always

  database:
#    user: "${PUID}:${PGID}"
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
#    user: "${PUID}:${PGID}"
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release}
    environment:
      # Make sure these values get passed through from the env file
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    ports:
      - 2283:8080
    depends_on:
      - immich-server
      - immich-web
    restart: always

volumes:
  pgdata:
  model-cache:
  tsdata:

Your .env content

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

PUID=1000
PGID=1000


# The location where your uploaded files are stored
UPLOAD_LOCATION=/mnt/hdd/photos
MICRO_LOCATION=/mnt/hdd/photos/micro
# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=...
DB_PASSWORD=...

# 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

TZ=Europe/Vienna

IMMICH_MACHINE_LEARNING_URL=http://192.168.1.2:3003

Reproduction steps

1. import the attached photo

Additional information

Tried to remove the tags, but the error is still thrown and thumbnails not generated.

Originally created by @peter-sc on GitHub (Sep 1, 2023). ### The bug I have assigned tags to photos in Digikam 8.1 (metadata are stored in photos and not sidecard files) and imported them to Immich. For the tagged photos, thumbnails are not generated and error is displayed: ``` [Nest] 7 - 09/01/2023, 2:57:23 PM ERROR [JobService] Unable to run job handler: Error: Input file has corrupt header: upload/library/admin/2022/07/2022-07-22_114344.HEIC: bad seek to 1868562 [Nest] 7 - 09/01/2023, 2:57:23 PM ERROR [JobService] Error: Input file has corrupt header: upload/library/admin/2022/07/2022-07-22_114344.HEIC: bad seek to 1868562 [Nest] 7 - 09/01/2023, 2:57:23 PM ERROR [JobService] Object: { "id": "89fa195c-d5d0-4b70-aa95-a40cd6a8d640", "source": "upload" } ``` ``` immich=# SELECT * FROM assets WHERE id='89fa195c-d5d0-4b70-aa95-a40cd6a8d640'; -[ RECORD 1 ]----+---------------------------------------------------- id | 89fa195c-d5d0-4b70-aa95-a40cd6a8d640 deviceAssetId | web-2022-07-22_114344-test.HEIC-1693571698268 ownerId | d9b4299f-98c9-4048-8479-1f99041574d6 deviceId | WEB type | IMAGE originalPath | upload/library/admin/2022/07/2022-07-22_114344.HEIC resizePath | fileCreatedAt | 2022-07-22 11:43:44+02 fileModifiedAt | 2023-09-01 14:34:58.268+02 isFavorite | f duration | 0:00:00.000000 webpPath | encodedVideoPath | checksum | \x1633a1833ada0c31fc680ea3014daf0e1b60eec2 isVisible | t livePhotoVideoId | updatedAt | 2023-09-01 14:57:23.703305+02 createdAt | 2023-09-01 14:57:20.593109+02 isArchived | f originalFileName | 2022-07-22_114344-test sidecarPath | isReadOnly | f thumbhash | ``` These details are extracted from photo and displayed in web: ![image](https://github.com/immich-app/immich/assets/6609134/f063f60f-6166-4eaa-b679-6aa3296d94f6) the photo: [2022-07-22_114344-test.zip](https://github.com/immich-app/immich/files/12498171/2022-07-22_114344-test.zip) ### The OS that Immich Server is running on Debian 12 ### Version of Immich Server v1.76.1 ### Version of Immich Mobile App v1.76.0 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" services: immich-server: user: "${PUID}:${PGID}" 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 env_file: - .env depends_on: - redis - database - typesense restart: always immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} user: "${PUID}:${PGID}" command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - ${MICRO_LOCATION}:/usr/src/app/.reverse-geocoding-dump env_file: - .env depends_on: - redis - database - typesense restart: always # immich-machine-learning: # container_name: immich_machine_learning # image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # user: "${PUID}:${PGID}" # volumes: # - model-cache:/cache # env_file: # - .env # restart: always immich-web: # user: "${PUID}:${PGID}" container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env restart: always typesense: # user: "${PUID}:${PGID}" container_name: immich_typesense image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd environment: - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} - TYPESENSE_DATA_DIR=/data # remove this to get debug messages - GLOG_minloglevel=1 volumes: - tsdata:/data restart: always redis: # user: "${PUID}:${PGID}" container_name: immich_redis image: redis:6.2-alpine@sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3 restart: always database: # user: "${PUID}:${PGID}" container_name: immich_postgres image: postgres:14-alpine@sha256:28407a9961e76f2d285dc6991e8e48893503cc3836a4755bbc2d40bcc272a441 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - pgdata:/var/lib/postgresql/data restart: always immich-proxy: # user: "${PUID}:${PGID}" container_name: immich_proxy image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release} environment: # Make sure these values get passed through from the env file - IMMICH_SERVER_URL - IMMICH_WEB_URL ports: - 2283:8080 depends_on: - immich-server - immich-web restart: always volumes: pgdata: model-cache: tsdata: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables PUID=1000 PGID=1000 # The location where your uploaded files are stored UPLOAD_LOCATION=/mnt/hdd/photos MICRO_LOCATION=/mnt/hdd/photos/micro # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secrets for postgres and typesense. You should change these to random passwords TYPESENSE_API_KEY=... DB_PASSWORD=... # 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 TZ=Europe/Vienna IMMICH_MACHINE_LEARNING_URL=http://192.168.1.2:3003 ``` ### Reproduction steps ```bash 1. import the attached photo ``` ### Additional information Tried to remove the tags, but the error is still thrown and thumbnails not generated.
Author
Owner

@peter-sc commented on GitHub (Sep 6, 2023):

The bug is present also on 1.77.0

[Nest] 7  - 09/06/2023, 1:12:02 PM    WARN [MediaRepository] Could not determine colorspace of image, defaulting to p3 profile
[Nest] 7  - 09/06/2023, 1:12:02 PM   ERROR [JobService] Unable to run job handler: Error: Input file has corrupt header: upload/library/admin/2022/06/2022-06-08_072405.HEIC: bad seek to 2719134

[Nest] 7  - 09/06/2023, 1:12:02 PM   ERROR [JobService] Error: Input file has corrupt header: upload/library/admin/2022/06/2022-06-08_072405.HEIC: bad seek to 2719134

[Nest] 7  - 09/06/2023, 1:12:02 PM   ERROR [JobService] Object:
{
  "id": "9079bde9-b336-4983-bc86-6ce0f3cc7628"
}
@peter-sc commented on GitHub (Sep 6, 2023): The bug is present also on 1.77.0 ``` [Nest] 7 - 09/06/2023, 1:12:02 PM WARN [MediaRepository] Could not determine colorspace of image, defaulting to p3 profile [Nest] 7 - 09/06/2023, 1:12:02 PM ERROR [JobService] Unable to run job handler: Error: Input file has corrupt header: upload/library/admin/2022/06/2022-06-08_072405.HEIC: bad seek to 2719134 [Nest] 7 - 09/06/2023, 1:12:02 PM ERROR [JobService] Error: Input file has corrupt header: upload/library/admin/2022/06/2022-06-08_072405.HEIC: bad seek to 2719134 [Nest] 7 - 09/06/2023, 1:12:02 PM ERROR [JobService] Object: { "id": "9079bde9-b336-4983-bc86-6ce0f3cc7628" } ```
Author
Owner

@nebulade commented on GitHub (Sep 14, 2023):

This seems to be the case for all heic pictures I've tried. Are there any users which have some example heic pictures which are known to work, to rule out deployment specific issues?

@nebulade commented on GitHub (Sep 14, 2023): This seems to be the case for all heic pictures I've tried. Are there any users which have some example heic pictures which are known to work, to rule out deployment specific issues?
Author
Owner

@peter-sc commented on GitHub (Sep 14, 2023):

Here are two more heic files, without added tags (original files without any modification), where the thumbnail generation and basic metadata extraction works correctly.
ok_heic.zip

@peter-sc commented on GitHub (Sep 14, 2023): Here are two more heic files, without added tags (original files without any modification), where the thumbnail generation and basic metadata extraction works correctly. [ok_heic.zip](https://github.com/immich-app/immich/files/12612819/ok_heic.zip)
Author
Owner

@nebulade commented on GitHub (Sep 15, 2023):

@peter-sc thanks, I tried with those files and seems like the same issue is happening there after upload:

Sep 15 13:01:18[Nest] 39 - 09/15/2023, 11:01:18 AM ERROR [JobService] Unable to run job handler: Error: upload/library/admin/2022/2022-08-07/IMG_1692.heic: bad seek to 3872200
Sep 15 13:01:18heif: Unsupported feature: Unsupported codec (4.3000)
Sep 15 13:01:18
Sep 15 13:01:18[Nest] 39 - 09/15/2023, 11:01:18 AM ERROR [JobService] Error: upload/library/admin/2022/2022-08-07/IMG_1692.heic: bad seek to 3872200
Sep 15 13:01:18heif: Unsupported feature: Unsupported codec (4.3000)
Sep 15 13:01:18
Sep 15 13:01:18[Nest] 39 - 09/15/2023, 11:01:18 AM ERROR [JobService] Object:
Sep 15 13:01:18{
Sep 15 13:01:18"id": "0e33cce7-09f8-434a-93ef-f1104fc61864",
Sep 15 13:01:18"source": "upload"
Sep 15 13:01:18}

Especially then Unsupported codec might indicate that some libraries are either missing or have not been compiled/configured for heic support. Does anyone have any ideas where to look further in that case? The environment here is a Cloudron app package, which essentially is based on system packages from Ubuntu 22.04

@nebulade commented on GitHub (Sep 15, 2023): @peter-sc thanks, I tried with those files and seems like the same issue is happening there after upload: ``` Sep 15 13:01:18[Nest] 39 - 09/15/2023, 11:01:18 AM ERROR [JobService] Unable to run job handler: Error: upload/library/admin/2022/2022-08-07/IMG_1692.heic: bad seek to 3872200 Sep 15 13:01:18heif: Unsupported feature: Unsupported codec (4.3000) Sep 15 13:01:18 Sep 15 13:01:18[Nest] 39 - 09/15/2023, 11:01:18 AM ERROR [JobService] Error: upload/library/admin/2022/2022-08-07/IMG_1692.heic: bad seek to 3872200 Sep 15 13:01:18heif: Unsupported feature: Unsupported codec (4.3000) Sep 15 13:01:18 Sep 15 13:01:18[Nest] 39 - 09/15/2023, 11:01:18 AM ERROR [JobService] Object: Sep 15 13:01:18{ Sep 15 13:01:18"id": "0e33cce7-09f8-434a-93ef-f1104fc61864", Sep 15 13:01:18"source": "upload" Sep 15 13:01:18} ``` Especially then `Unsupported codec` might indicate that some libraries are either missing or have not been compiled/configured for heic support. Does anyone have any ideas where to look further in that case? The environment here is a Cloudron app package, which essentially is based on system packages from Ubuntu 22.04
Author
Owner

@peter-sc commented on GitHub (Sep 18, 2023):

@nebulade I have found similar error here: https://github.com/lovell/sharp/issues/2713 , where they suggest a solution too.

@peter-sc commented on GitHub (Sep 18, 2023): @nebulade I have found similar error here: https://github.com/lovell/sharp/issues/2713 , where they suggest a solution too.
Author
Owner

@nebulade commented on GitHub (Sep 18, 2023):

This solution suggests to use libvips v8.10.6 in our case we have https://packages.ubuntu.com/jammy/libvips42 (v8.12) so that shouldn't be the issue unfortunately.

@nebulade commented on GitHub (Sep 18, 2023): This solution suggests to use libvips v8.10.6 in our case we have https://packages.ubuntu.com/jammy/libvips42 (v8.12) so that shouldn't be the issue unfortunately.
Author
Owner

@timworld commented on GitHub (Nov 13, 2023):

Got the same issue, I'm running Immich under Cloudron.

@timworld commented on GitHub (Nov 13, 2023): Got the same issue, I'm running Immich under Cloudron.
Author
Owner

@I-Would-Like-To-Report-A-Bug-Please commented on GitHub (Nov 15, 2023):

Same here, weirdly it was all fine till couple days ago.

@I-Would-Like-To-Report-A-Bug-Please commented on GitHub (Nov 15, 2023): Same here, weirdly it was all fine till couple days ago.
Author
Owner

@NicholasFlamy commented on GitHub (Aug 31, 2024):

Is this still a problem?

@NicholasFlamy commented on GitHub (Aug 31, 2024): Is this still a problem?
Author
Owner

@nebulade commented on GitHub (Aug 31, 2024):

@NicholasFlamy thanks for following up. Just retried with the provided test images from @peter-sc and the issue at least for those on Cloudron it is solved by now.

@nebulade commented on GitHub (Aug 31, 2024): @NicholasFlamy thanks for following up. Just retried with the provided test images from @peter-sc and the issue at least for those on Cloudron it is solved by now.
Author
Owner

@peter-sc commented on GitHub (Aug 31, 2024):

@NicholasFlamy I have imported the same pictures +some more, and the issue is fixed. Thank you !

@peter-sc commented on GitHub (Aug 31, 2024): @NicholasFlamy I have imported the same pictures +some more, and the issue is fixed. Thank you !
Author
Owner

@NicholasFlamy commented on GitHub (Aug 31, 2024):

Alright, I will close this issue, glad that it's working!

@NicholasFlamy commented on GitHub (Aug 31, 2024): Alright, I will close this issue, glad that it's working!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1297