Skip to content

Thumbnail Generation fails for HEIC images #680

@hulk66

Description

@hulk66

Since recent versions, it seems the Immich build has problem with generating thumbnails from HEIC photos. Not exactly sure, when this started to happen as I'm frequently updating Immch whenever there is a new image. I initially raised a bug on Immich itself but they claimed, it would be not on their side (immich-app/immich#27649) but has to do with the build.

OS: Unraid 7.2.4
Immich: 2.7.3 (seems also to be a problem in 2.7.0 and 2.7.2)

This I see in the log:
run job handler (AssetGenerateThumbnails): Error: /import/Tobias/2026/04/26-04-09 18-34-17 4944.heic: bad seek to 1875929 /import/Tobias/2026/04/26-04-09 18-34-17 4944.heic: bad seek to 1875900 /import/Tobias/2026/04/26-04-09 18-34-17 4944.heic: bad seek to 1875898 heif: Decoder plugin generated an error: Unspecified (7.0) Error: /import/Tobias/2026/04/26-04-09 18-34-17 4944.heic: bad seek to 1875929 /import/Tobias/2026/04/26-04-09 18-34-17 4944.heic: bad seek to 1875900 /import/Tobias/2026/04/26-04-09 18-34-17 4944.heic: bad seek to 1875898 heif: Decoder plugin generated an error: Unspecified (7.0) at Sharp.toBuffer (/app/immich/server/node_modules/.pnpm/sharp@0.34.5/node_modules/sharp/lib/output.js:163:17) at MediaRepository.decodeImage (/app/immich/server/dist/repositories/media.repository.js:120:31) at process.processTicksAndRejections (node:internal/process/task_queues:104:5) at async MediaService.decodeImage (/app/immich/server/dist/services/media.service.js:186:32) at async MediaService.extractOriginalImage (/app/immich/server/dist/services/media.service.js:197:44) at async MediaService.generateImageThumbnails (/app/immich/server/dist/services/media.service.js:213:32) at async MediaService.handleGenerateThumbnails (/app/immich/server/dist/services/media.service.js:153:25) at async JobService.onJobRun (/app/immich/server/dist/services/job.service.js:51:30) at async EventRepository.onEvent (/app/immich/server/dist/repositories/event.repository.js:91:13) at async /app/immich/server/node_modules/.pnpm/bullmq@5.71.0/node_modules/bullmq/dist/cjs/classes/worker.js:570:32

The photos themselves are fine, I'm able to download them from Immich and on Mac the conversion to JPG works flawlessly. If needed, I can provide a HEIC Photo from my iPhone.

This is how I start Immich on Unraid.

docker run -d --name='immich' --net='REMOVED' --pids-limit 2048 -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e HOST_HOSTNAME="REMOVED" -e HOST_CONTAINERNAME="immich" -e 'DB_HOSTNAME'='REMOVED' -e 'DB_USERNAME'='REMOVED' -e 'DB_PASSWORD'='REMOVED' -e 'DB_DATABASE_NAME'='immich' -e 'REDIS_HOSTNAME'='REMOVED' -e 'DISABLE_MACHINE_LEARNING'='false' -e 'DISABLE_TYPESENSE'='false' -e 'DB_PORT'='5432' -e 'REDIS_PORT'='6379' -e 'REDIS_PASSWORD'='REMOVED' -e 'MACHINE_LEARNING_WORKERS'='1' -e 'MACHINE_LEARNING_WORKER_TIMEOUT'='120' -e 'PUID'='99' -e 'PGID'='100' -e 'UMASK'='022' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://REMOVED:[PORT:8080]' -l net.unraid.docker.icon='https://raw.githubusercontent.com/imagegenius/templates/main/unraid/img/immich.png' -p '18080:8080/tcp' -v '/mnt/user/immich_photos':'/photos':'rw' -v '/mnt/cache/appdata/immich/machine-learning/':'/config/machine-learning':'rw' -v 'REMOVED/files/Photos/':'/import':'rw' -v '/mnt/cache/appdata/immich':'/config':'rw' --device='/dev/dri' --gpus all 'ghcr.io/imagegenius/immich' b8fc0d3b0f2f394dc17950365fdfb8a99537033991c8f50588e123e1f5884a6d

I searched a bit myself about sharp where the error appears but there doesn't seem to be a new version recently.

It worked like this for more than 1.5 years with 80k assets, so any clue appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions