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

iOS 18 HEIC Images - Thumbnail Generation Fails #10464

Open
1 of 3 tasks
rlobbins opened this issue Jun 18, 2024 · 5 comments
Open
1 of 3 tasks

iOS 18 HEIC Images - Thumbnail Generation Fails #10464

rlobbins opened this issue Jun 18, 2024 · 5 comments

Comments

@rlobbins
Copy link

rlobbins commented Jun 18, 2024

IMG_1190.zip

The bug

Since installing 1.106.4 and updating to the iOS 18 beta, any image taken by my phone that is uploaded from my iOS device fails to create thumbnails/web previews. Logs state the files have incorrect headers. Photos sent to me and saved/backed up from iOS 17 devices continue to function as normal. Only photos taken with iOS 18 seem to be affected.

The OS that Immich Server is running on

Ubuntu 22.04

Version of Immich Server

V1.106.4

Version of Immich Mobile App

v1.106.3 build 160

Platform with the issue

  • Server
  • Web
  • Mobile

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}
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
       file: hwaccel.transcoding.yml
       service: nvenc # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-cuda
    extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
       file: hwaccel.ml.yml
       service: cuda # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

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

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    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

volumes:
  pgdata:
  model-cache:

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=/mnt/array/apps/immich

# 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=

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

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Update device to iOS 18
2. Attempt to backup images taken after the update
3. Server fails to generate thumbnails

Relevant log output

[Nest] 17  - 06/18/2024, 5:41:47 PM VERBOSE [Api:LoggingInterceptor~idwlr3vh] {"assetIds":["34e9b298-7961-478c-8ac3-c3c121653674"],"name":"regenerate-thumbnail"}
[Nest] 7  - 06/18/2024, 5:41:47 PM   ERROR [Microservices:JobService] Unable to run job handler (thumbnailGeneration/generate-preview): Error: Input file has corrupt header: upload/library/admin/2024/2024-06-14/IMG_1190.HEIC: bad seek to 4809486
heif: Invalid input: Unspecified: Metadata not correctly assigned to image (2.0)
[Nest] 7  - 06/18/2024, 5:41:47 PM   ERROR [Microservices:JobService] Error: Input file has corrupt header: upload/library/admin/2024/2024-06-14/IMG_1190.HEIC: bad seek to 4809486
heif: Invalid input: Unspecified: Metadata not correctly assigned to image (2.0)
    at Sharp.toFile (/usr/src/app/node_modules/sharp/lib/output.js:89:19)
    at MediaRepository.generateThumbnail (/usr/src/app/dist/repositories/media.repository.js:69:14)
    at MediaService.generateThumbnail (/usr/src/app/dist/services/media.service.js:158:48)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async MediaService.handleGeneratePreview (/usr/src/app/dist/services/media.service.js:135:29)
    at async /usr/src/app/dist/services/job.service.js:148:36
    at async Worker.processJob (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:394:28)
    at async Worker.retryIfFailed (/usr/src/app/node_modules/bullmq/dist/cjs/classes/worker.js:581:24)
[Nest] 7  - 06/18/2024, 5:41:47 PM   ERROR [Microservices:JobService] Object:
{
  "id": "34e9b298-7961-478c-8ac3-c3c121653674"
}

Additional information

No response

@mertalev
Copy link
Contributor

There's an open libheif issue for this here. We can upgrade once they patch this.

@othyn
Copy link
Contributor

othyn commented Jun 20, 2024

Hopefully libheif support will arrive soon! As +1, I'm having the same issue.

Is it safe to continue uploading images in the meantime, then once libheif is updated and support rolled in, we can just run a 'missing thumbnails' job to backdate them all?

@alextran1502
Copy link
Contributor

@othyn yes, running missing thumbnail job will resolve the issue

@othyn
Copy link
Contributor

othyn commented Jun 20, 2024

Super, thank you for confirming!

@samip5
Copy link
Contributor

samip5 commented Jun 24, 2024

Oh, of course it's an IOS 18 thing... :DDDDD

This is what I get from using an beta.

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

5 participants