immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
42.62k stars 2.08k forks source link

[BUG] Android app ignores some local images (which might contain wrong metadata) #6196

Open Hyffer opened 7 months ago

Hyffer commented 7 months ago

The bug

I am using the official android app to back up my photos. The app works great and It detect all picture folders, except that some of images are missing in immich app. (The missing images is visible in my phone's native gallery app. And other images in the same directory as the missing ones are showing up correctly in immich.)

I suppose the metadata of image is to be blame. Although I am not familiar with exif kind of things, another gallery app (Les Pas, shows the image, but) says the image size is 0w*0h, which is definitely incorrect. The image is posted below. -990f2baad6699c6

(to avoid picture got compressed and metadata got lost, I also make it a zip pack) -990f2baad6699c6.jpg.zip

Now I guess that the immich app actually do read in this image, but due to some metadata related errors, it skips this one. (But I don't see anything related in logs)

BTW in most cases it should not be a problem, photos we take will have correct metadata. My situation is this "broken" image is saved from a chat app (QQ, which is commonly used in China), and lots of images saved from it have the same issue (like the size 0w*0h I mentioned).

The OS that Immich Server is running on

ubuntu 22.04

Version of Immich Server

v1.91.4

Version of Immich Mobile App

v1.91.4

Platform with the issue

Your docker-compose.yml content

(This problem should has nothing to do with server.)

version: "3.8"
name: immich
services:
  immich-server:
    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
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always

  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: always

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

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
    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

UPLOAD_LOCATION=./immich-library
IMMICH_VERSION=release
DB_PASSWORD=postgres
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis

Reproduction steps

1. On Android(I don't know if iOS has the same thing), download the picture I posted and copy it to image folder
2. You can see it does not show up in immich app

Additional information

No response

Hyffer commented 7 months ago

It is so wired, cannot even reproduce the issue on android emulator.

I connected to my phone and find this problem is caused by flutter_photo_manager filtering out those 0w*0h pictures. My current workaround is manually set filterOption when calling getAssetPathList. There is a param called ignoreSize inside, setting it to true solves the problem. But I don't know will it brings side effects when doing so.

截屏2024-01-06 23 01 34

And there is another call I think should also need modifying. (pure guess, I know little about this code strucure)

截屏2024-01-06 23 05 49

I also open an issue on flutter_photo_manager repository: https://github.com/fluttercandies/flutter_photo_manager/issues/1069

Wondering if anyone could reproduce the issue. (My device is android 10, EMUI 11.0.0). If it is only a problem of my phone, maybe I should fix it myself XD.

phynias commented 2 months ago

Wondering if this is still the fix. Just noticed MP images are being ignored for me as well. I'm on 1.106.3

UPDATE: just realized my issue is different. the exif data on my photos looks good. just seems to be random MP.jpg files are missing.

miahi commented 2 months ago

I seem to have the same problem as @phynias - the immich Android app does not show some local photos at all. Today I took a few photos with my phone in a ~30 seconds interval, one of the photos appears in the immich app's "Photos" tab (and it's synced on the server), the others do not. Other photo apps on the device (samsung/google photos) do show these photos and they were taken with the same app (samsung camera) without stopping so I don't think it's a metadata issue.

I tried removing the directory from the "Backup Albums" list and re-adding it, the same photos are not shown. I took 30 photos today (all in the 'Camera' album/directory) and about half of them are not shown in the app and not synced to server.

I attached screenshots of the immich app with all the photos it shows for today and google photos with all the photos it shows for today, and circled the photos that immich does not show (immich does show some other photos between the ones that it does see in google photos, but those are from the whatsapp photos album). So about half of them are not seen and I don't see any pattern or rule for this.

signal-2024-06-22-162244 signal-2024-06-22-162317

Also, when I go to Backup Albums to select the albums to back up, then click the icon on the right to check the contents, the missing photos are shown there.

Two of the photos from today that do not show are reported in the app log as duplicates and I created 10546 for them, but the others are still not explained.

I attached one of the photos in original here: 20240622_140906.zip

miahi commented 1 month ago

As discussed in https://github.com/immich-app/immich/issues/10546, my issue is caused by moving the data to a different phone without resetting the immich persistent storage - it seems that immich is not supporting it at this point.

wioo commented 1 week ago

Something similar here. Immich android app wont show pictures saved from signal app. Map Pictures on local storage has more than 120 pictures bit Immich shows only 37.