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

Closed
1 of 3 tasks
rlobbins opened this issue Jun 18, 2024 · 30 comments · Fixed by #11066
Closed
1 of 3 tasks

iOS 18 HEIC Images - Thumbnail Generation Fails #10464

rlobbins opened this issue Jun 18, 2024 · 30 comments · Fixed by #11066

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.

@coltography
Copy link

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

It's showing as completed/closed now. Is it actually fixed and ready for update?
I can't really tell based off the last comment they made on that issue.

@mertalev
Copy link
Contributor

It's merged, but they haven't made a release since then.

@tecnicx15
Copy link

For those wondering the new update 1.107 has not yet fixed the issue.

@samip5
Copy link
Contributor

samip5 commented Jul 2, 2024

For those wondering the new update 1.107 has not yet fixed the issue.

Of course not as the libheif hasn't yet cut a new release that Immich could pull.

@alextran1502 alextran1502 mentioned this issue Jul 9, 2024
3 tasks
@SisyphusMD
Copy link

Happy day. Looks like libheif v1.18.0 has been released with a fix.

@pducharme
Copy link

@SisyphusMD Do you know if it's included in the 1.108 build released just minutes ago ?

@alextran1502
Copy link
Contributor

No it doesn't. It hasn't been released on Debian repository yet afaik. We are monitoring to see how long it would take and will build it ourselves if it takes too long

@pducharme
Copy link

@alextran1502 Maybe you can answer my quesiton. When it will be added, we will only have to run a new "generate Thumbnails (Missing)" job to fix them all at once?

@alextran1502
Copy link
Contributor

@pducharme yes sir

@9k001
Copy link

9k001 commented Jul 10, 2024

@pducharme yes sir

I sincerely hope that this problem will be repaired quickly. Because of this problem, I don't sync new photos now.
Is this button on the web?
I tried to click the Refresh thumbnails in the new version, but he didn't respond.
At the same time, I found that the EXIF information of HEIC pictures was also missing

@samip5
Copy link
Contributor

samip5 commented Jul 10, 2024

No it doesn't. It hasn't been released on Debian repository yet afaik. We are monitoring to see how long it would take and will build it ourselves if it takes too long

To my understanding, Debian packages take extremely long to get packaged, or at least to a non unstable repo. I would highly recommend to not wait for it.

@muammar
Copy link

muammar commented Jul 12, 2024

No it doesn't. It hasn't been released on Debian repository yet afaik. We are monitoring to see how long it would take and will build it ourselves if it takes too long

To my understanding, Debian packages take extremely long to get packaged, or at least to a non unstable repo. I would highly recommend to not wait for it.

I second this. I am a non-so-active-anymore Debian developer, and Debian does not update packages that fast unless you are using debian unstable or experimental for your docker images. Even those two debian branches are not updated to the cutting edge versions so fast. That's because of dependencies or because we are close to a Debian release.

@mertalev
Copy link
Contributor

We were specifically waiting for Debian unstable to update libheif. But since libheif has a lot of dependencies through plugins, you might be right that it won't be that quick. We can just build it ourselves.

@muammar
Copy link

muammar commented Jul 12, 2024

We were specifically waiting for Debian unstable to update libheif. But since libheif has a lot of dependencies through plugins, you might be right that it won't be that quick. We can just build it ourselves.

We could ask the multimedia team on the BTS to upload to experimental. I could not find any freeze happening soon: https://release.debian.org/trixie/freeze_policy.html

@mertalev
Copy link
Contributor

mertalev commented Jul 13, 2024

We were specifically waiting for Debian unstable to update libheif. But since libheif has a lot of dependencies through plugins, you might be right that it won't be that quick. We can just build it ourselves.

We could ask the multimedia team on the BTS to upload to experimental. I could not find any freeze happening soon: release.debian.org/trixie/freeze_policy.html

Thanks for the suggestion! But I think it's simple to build it ourselves and may be better in the long run - libheif is a very imporant dependency that has to evolve with emerging standards etc. for these newer formats.

@cur1ou5soul
Copy link

Maybe I just got a blind spot, but, how can I update my base image via the docker-compose?

@othyn
Copy link
Contributor

othyn commented Jul 16, 2024

Maybe I just got a blind spot, but, how can I update my base image via the docker-compose?

There hasn't been another Immich container release yet, the 'base images' are just internally what they are built on top of. I think.

@muammar
Copy link

muammar commented Jul 18, 2024

How could we know the timeline of new releases? It would be nice to see the HEIC images thumbnail generation fail fixed.

@alextran1502
Copy link
Contributor

Prepping for a release today

@mertalev
Copy link
Contributor

We're looking to make a new release today.

@Valpha
Copy link

Valpha commented Jul 18, 2024

刚刚发现遇到了这个问题,于是来这里搜索答案,发现正好赶上热乎的 new release 开心!😆
感谢大佬! Thanks @alextran1502 @mertalev

@rlobbins
Copy link
Author

rlobbins commented Jul 18, 2024

Thanks for the urgency, sorry that it was due to a dependency upstream and not Immich. I just figured I should report it since I noticed it before iOS hit final public release in September, just to make sure it didn’t fall through the cracks. I was not expecting any fixes so quickly and appreciate the efforts of everyone involved.

@othyn
Copy link
Contributor

othyn commented Jul 18, 2024

Just a friendly ping to everyone watching this thread, v1.109.x is out with this patch.

@rlobbins
Copy link
Author

rlobbins commented Jul 18, 2024

Thanks, seems to work with a generate missing thumbnails command. Pretty disappointing to hear the licensing and direction the project is going towards though, before it has even hit stable status. Sad to see. All the best to you in the future.

@pducharme
Copy link

Thanks! the fix worked for me, after I regen the missing thumbnails. I also bought a Lifetime 99$ licence to support the project, thanks for the great work!

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

Successfully merging a pull request may close this issue.