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

[BUG] iOS live photos which have been rotateed or an effect are shown as separate images and videos in immich #5473

Closed
1 of 3 tasks
philw07 opened this issue Dec 3, 2023 · 29 comments
Labels
bug Something isn't working

Comments

@philw07
Copy link

philw07 commented Dec 3, 2023

The bug

When uploading a live photo from iOS which has either been rotated or an effect (bounce, loop, etc.), it will be displayed as separate photo and video in immich.
In case of rotated photos, the video has the original orientation.
I would expect it to show as a regular live photo in immich (without any effect, but ideally rotated correctly).

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.89.0

Version of Immich Mobile App

v1.89.0

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ["start.sh", "immich"]
    volumes:
      - photos:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: unless-stopped
    networks:
      - default
      - web
    labels:
      <traefik labels>

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: ["start.sh", "microservices"]
    volumes:
      - photos:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: unless-stopped

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: unless-stopped

  typesense:
    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: unless-stopped

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:80cc8518800438c684a53ed829c621c94afd1087aaeb59b0d4343ed3e7bcf6c5
    restart: unless-stopped

  database:
    container_name: immich_postgres
    image: postgres:14-alpine@sha256:50d9be76e9a90da4c781554955e0ffc79d9d5c4226838e64b36aacc97cbc35ad
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: unless-stopped


networks:
  web:
    external: true


volumes:
  pgdata:
  model-cache:
  tsdata:
  photos:
    <nfs share options>

Your .env content

IMMICH_VERSION=release

TYPESENSE_API_KEY=<pw>
DB_PASSWORD=<pw>

DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Take a live photo on iOS device
2. Rotate it or add an effect (bounce, lopp, etc.)
3. Upload the photo to immich
4. Immich will show a separate photo and video

Additional information

No response

@philw07 philw07 added bug Something isn't working needs triage Bug that needs triage from maintainer labels Dec 3, 2023
@shenlong-tanwen
Copy link
Member

@philw07 Can you please check if the live photo is linked properly in the web version? And, if it does, can you swipe down twice in the main timeline of the mobile app to trigger a force refresh of the asset state and check if that fixes your issue?

@philw07
Copy link
Author

philw07 commented Dec 3, 2023

@shenlong-tanwen It’s also not linked in the web interface.

@shenlong-tanwen
Copy link
Member

@shenlong-tanwen It’s also not linked in the web interface.

Odd. Does this happen only for live photo with edits? Also, is it possible to share such live photo as a file to reproduce the issue?

You can also check the following things:

  • Ensure that the Meta data extraction job is running and refresh the metadata manually for the still and motion part of the live photo from the web app
  • Check if both the photo and motion part of the live photo has the livePhotoCID EXIF tag set and to be equal for both the assets.

@philw07
Copy link
Author

philw07 commented Dec 3, 2023

Does this happen only for live photo with edits?

Yes, I've uploaded dozens of live photos and only edited ones are displayed separately.

Also, is it possible to share such live photo as a file to reproduce the issue?

Sorry, I can't share any at the moment, but if you have access to an iOS device it's literally as easy as taking a live photo and rotating it via Edit → Crop → Rotate → Save.

Ensure that the Meta data extraction job is running and refresh the metadata manually for the still and motion part of the live photo from the web app

I think it ran, as the non-edited live photos are recognized as such and also other metadata like location and camera are available.
Re-running it manually for an affected photo and video had no effect.

Check if both the photo and motion part of the live photo has the livePhotoCID EXIF tag set and to be equal for both the assets.

Where can I check this?
I didn't find anything in the immich UI and am unable to check the photo/video files at the moment.

I found a similar issue in #4209 with the livePhotoCID keyword, so I am leaving the link here just in case.

@mike12806

This comment was marked as resolved.

@shenlong-tanwen

This comment was marked as resolved.

@philw07
Copy link
Author

philw07 commented Dec 5, 2023

So after some reading, I took a live photo and uploaded it to immich and checked the exif using exiftool afterwards.
The image was correctly displayed as a live photo in immich and both the HEIC image and MOV video had the same identifier.

$ exiftool -a -u -g1 IMG_4331.HEIC | grep UUID
Media Group UUID                : 0B62DBD0-DF75-4CBC-8F33-EDEAD7F3E5DF

$ exiftool -a -u -g1 IMG_4331.MOV | grep Identifier
Content Identifier              : 0B62DBD0-DF75-4CBC-8F33-EDEAD7F3E5DF

Afterwards, I deleted the photo and rotated it in iOS, then uploaded it again.
This time, it was displayed as separate photo and video in immich.
I checked the exif data again and indeed the identifier of the image was changed, but the identifier of the video stayed the same.

$ exiftool -a -u -g1 IMG_4331.HEIC | grep UUID
Media Group UUID                : 8CC62E05-CA31-49F8-A114-C3FFD2FEBD6F

$ exiftool -a -u -g1 IMG_4331.MOV | grep Identifier
Content Identifier              : 0B62DBD0-DF75-4CBC-8F33-EDEAD7F3E5DF

This seems to explain why immich can't link them.
Unfortunately, I could neither find the new ID in the video metadata, nor the old one in the image metadata.
Hence I'm not sure if it's possible to link them after the image has been edited.

@mike12806
Copy link

I'm seeing this without having edited the photo. Re-running metadata extraction fixes it.

@ChristopherFunk
Copy link

I'm seeing this without editing the photos, and re-running metadata extraction does not fix it for me

@shenlong-tanwen
Copy link
Member

I'm seeing this without editing the photos, and re-running metadata extraction does not fix it for me

Are your assets not linked in the web app as well? If so, Can you share the original photo and video asset that are supposed to be linked together? If they have sensitive or personal info, Can you try reproducing it with a new Live photo and share it with us for troubleshooting?

@ChristopherFunk
Copy link

Hello, yes it is happening in web, I have older photos where this happens too, starting December 1st (which is weird I don't think it happened around a release).
Also confirming I went to the web and under admin re-ran EXTRACT METADATA on ALL photos

This is from today

  • Photos in the web, it's hard to tell but the right photo has the 0:01 Play button icon in it
    live photo split into 2 on web

  • Photo
    photo-from-live-photo

  • Video
    video-from-live-photo

and here they are downloaded from immich web:

and the original photo:

This is coming from an iPhone 14 Pro, and I just checked the app version is up to date, v1.89.0, server on same version

Let me know if you need anything else, happy to help!

@shenlong-tanwen
Copy link
Member

@philw07 / @ChristopherFunk Both of your issues should be fixed in the next version of the app. We'll keep this issue open until the next release.

@shenlong-tanwen shenlong-tanwen removed the needs triage Bug that needs triage from maintainer label Dec 11, 2023
@philw07
Copy link
Author

philw07 commented Dec 11, 2023

Fantastic, thanks so much.
I will check when the update is available.

@ChristopherFunk
Copy link

Woohoo! Thanks so much! I'm assuming we'll need to do another metadata refresh to fix existing photos?

@shenlong-tanwen
Copy link
Member

Woohoo! Thanks so much! I'm assuming we'll need to do another metadata refresh to fix existing photos?

Sadly, The live photos has to be removed and re-uploaded again for them to be properly linked. This shouldn't hopefully be required again in the future. Apologies for the trouble caused. We'll get this added to the release notes as well, asking users to re-upload their unlinked live photos from the iOS app.

@smndtrl
Copy link

smndtrl commented Dec 17, 2023

@shenlong-tanwen In which commit was this fixed? I'm curious how this was solved.
I might have a few hundred of those images where the tag in EXIF does not match and there are no "originals" available on the phone anymore.

@philw07
Copy link
Author

philw07 commented Dec 17, 2023

I updated my server and app and re-uploaded several live photos as well as taking and editing some new photos.
Everything seems to be linked correctly, so from my point of view this ticket can be closed.
I’m keeping it open for @ChristopherFunk to confirm it’s working on his side.

@shenlong-tanwen Thanks again.

@smndtrl I think that would be #5602.

@smndtrl
Copy link

smndtrl commented Dec 17, 2023

Interesting. I'm wondering if that change lead to the other issue I'm seeing.
A live photo (bounce effect) export is correctly matched, yet the file metadata and quality is hugely affected. See the second image with resolution, filesize and missing metadata like GPS.

My app version is 1.91.2 and the server runs on 1.90.2

The following image shows IMG_6086 (1), which is the export from Apple Photos vs IMG_6086, the download from the immich server.
image

The live photo is matched fine since the update.
image

If switching off the live photo effect, the same photo is displayed like this.
image
With more similar file sizes to the Apple Photos export.
image

@philw07 Did you notice something similar for recent live photos with effects? If not, I'm going to have to open up a new issue to figure this out.

@alextran1502
Copy link
Contributor

@smndtrl hello, do you know if those LivePhotos get edited anyway after being taken?

@smndtrl
Copy link

smndtrl commented Dec 17, 2023

The only thing I did was to

  1. switch from Live to Bounce
  2. Then sync from iOS to the server
  3. Download them (small HEIC)
  4. Switch from Bounce to Live
  5. Delete image from server
  6. Sync again from iOS

All looks good on the server

No cropping, painting, rotating or anything else. I didn't even use the Edit menu but the quick switcher.

@philw07
Copy link
Author

philw07 commented Dec 17, 2023

I didn’t notice it before, but I can confirm it also happens on my side.

@WolfgangDpunkt
Copy link

WolfgangDpunkt commented Dec 18, 2023

How can we identify photos that need to be deleted and re-uploaded?
I uploaded thousands of iOS-photos during this specific period. I have them backed up in iCloud, so it is not a big problem. However, I want to locate the photos that require deletion and re-upload to be properly linked. Is there a search string specifically for iOS photos?
(Crosspost from Reddit, sorry, but I was not sure if it will be noticed there)

@shenlong-tanwen
Copy link
Member

@shenlong-tanwen In which commit was this fixed? I'm curious how this was solved. I might have a few hundred of those images where the tag in EXIF does not match and there are no "originals" available on the phone anymore.

#5601

There are two ways in which assets are linked together as live photos. i) both the video and photo asset are uploaded together in the same upload request 2) matching "Content Identifier" metadata

We thought of removing i) and use ii) for linking live photos always and released the mobile app changes as such. But looks like not all livePhoto's still and motion part have matching metadata, like from the few examples above, which resulted in them not getting linked together since we started relying on only the metadata. The fix was to actually revert it and go back to uploading both the assets together in the same request and the server would link them without going through the metadata. This was also why we requested the existing un-linked livephotos to be removed and re uploaded again.

@shenlong-tanwen
Copy link
Member

@philw07 Did you notice something similar for recent live photos with effects? If not, I'm going to have to open up a new issue to figure this out.

Can you raise this as a separate issue?

@shenlong-tanwen
Copy link
Member

shenlong-tanwen commented Dec 18, 2023

How can we identify photos that need to be deleted and re-uploaded? I uploaded thousands of iOS-photos during this specific period.

You can check the comment by Christopher - #5473 (comment)

The still and motion photos are getting displayed as two different assets in the timeline, which means that the live photo is not properly linked

@ChristopherFunk
Copy link

ChristopherFunk commented Jan 5, 2024

I updated my server and app and re-uploaded several live photos as well as taking and editing some new photos. Everything seems to be linked correctly, so from my point of view this ticket can be closed. I’m keeping it open for @ChristopherFunk to confirm it’s working on his side.

@shenlong-tanwen Thanks again.

@smndtrl I think that would be #5602.

Hi sorry! It's all working on my end! Been uploading photo's like crazy and no issue on my end! 😄

Ahh I kept reading, I haven't tried any of these other effects in my photo's, but the simple snap and upload is working for me.
Editing the photo by changing the Key Frame in a live photo doesn't break it for me either, but I haven't tried any of the other effects.

@CarterMoody
Copy link

Still an issue for me on 1.102.3 I have the exact same symptoms as this. This has not been fixed? :

Hello, yes it is happening in web, I have older photos where this happens too, starting December 1st (which is weird I don't think it happened around a release). Also confirming I went to the web and under admin re-ran EXTRACT METADATA on ALL photos

This is from today

  • Photos in the web, it's hard to tell but the right photo has the 0:01 Play button icon in it
    live photo split into 2 on web
  • Photo
    photo-from-live-photo
  • Video
    video-from-live-photo

and here they are downloaded from immich web:

and the original photo:

This is coming from an iPhone 14 Pro, and I just checked the app version is up to date, v1.89.0, server on same version

Let me know if you need anything else, happy to help!

@alextran1502
Copy link
Contributor

@CarterMoody if a LivePhotos is modified, it will lose the information that we need to link the two files together... and this is due to how Apple handles file editing, unfortunately

@CarterMoody
Copy link

@alextran1502 I have not modified any of these photos yet they still show up this way. I have run the metadata extraction job on my entire library and they still show up as both a still and a live photo separately. What do I need to do to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants