[PR #4095] [MERGED] feat(mobile): image caching & viewer improvements #10247

Closed
opened 2026-02-05 14:18:26 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/4095
Author: @fyfrey
Created: 9/14/2023
Status: Merged
Merged: 9/18/2023
Merged by: @alextran1502

Base: mainHead: dev/mobile-custom-image-cache


📝 Commits (1)

  • 576d592 feat(mobile): image caching & viewer improvements

📊 Changes

10 files changed (+283 additions, -212 deletions)

View changed files

📝 mobile/lib/main.dart (+2 -1)
📝 mobile/lib/modules/asset_viewer/views/gallery_viewer.dart (+83 -171)
mobile/lib/shared/cache/custom_image_cache.dart (+69 -0)
mobile/lib/shared/cache/original_image_provider.dart (+73 -0)
mobile/lib/shared/cache/widgets_binding.dart (+8 -0)
📝 mobile/lib/shared/models/asset.dart (+1 -0)
📝 mobile/lib/shared/ui/immich_image.dart (+31 -37)
📝 mobile/lib/shared/ui/photo_view/photo_view.dart (+7 -1)
📝 mobile/lib/shared/ui/photo_view/photo_view_gallery.dart (+5 -1)
📝 mobile/lib/shared/ui/photo_view/src/photo_view_wrappers.dart (+4 -1)

📄 Description

huge UX improvement for viewing images in the app

  • smooth swiping between assets in the viewer
  • no reloading of thumbnails after returning from viewer
  • faster loading of original assets from device

how

  • loadingBuilder in photo view was showing the wrong preview because index was updated only afterwards.
  • improved the photo view gallery to include the index in the loadingBuilder callback
  • loading original assets from device removed many thumbnails from the cache because originals are huge
  • build a custom ImageCache that distinguishes between original images from local device and all other images. it uses two different caches internally (one for large originals, one for all others)
  • implemented a custom ImageProvider for faster loading of originals from the device

required testing

There are some scenarios I cannot test. Somebody else please test

  • iOS
  • viewing heic/heif images from device
  • viewing LivePhotos from device

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/4095 **Author:** [@fyfrey](https://github.com/fyfrey) **Created:** 9/14/2023 **Status:** ✅ Merged **Merged:** 9/18/2023 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `dev/mobile-custom-image-cache` --- ### 📝 Commits (1) - [`576d592`](https://github.com/immich-app/immich/commit/576d59212e17fc7ad215a5190d9a257da8763804) feat(mobile): image caching & viewer improvements ### 📊 Changes **10 files changed** (+283 additions, -212 deletions) <details> <summary>View changed files</summary> 📝 `mobile/lib/main.dart` (+2 -1) 📝 `mobile/lib/modules/asset_viewer/views/gallery_viewer.dart` (+83 -171) ➕ `mobile/lib/shared/cache/custom_image_cache.dart` (+69 -0) ➕ `mobile/lib/shared/cache/original_image_provider.dart` (+73 -0) ➕ `mobile/lib/shared/cache/widgets_binding.dart` (+8 -0) 📝 `mobile/lib/shared/models/asset.dart` (+1 -0) 📝 `mobile/lib/shared/ui/immich_image.dart` (+31 -37) 📝 `mobile/lib/shared/ui/photo_view/photo_view.dart` (+7 -1) 📝 `mobile/lib/shared/ui/photo_view/photo_view_gallery.dart` (+5 -1) 📝 `mobile/lib/shared/ui/photo_view/src/photo_view_wrappers.dart` (+4 -1) </details> ### 📄 Description # huge UX improvement for viewing images in the app - smooth swiping between assets in the viewer - no reloading of thumbnails after returning from viewer - faster loading of original assets from device ## how - loadingBuilder in photo view was showing the wrong preview because index was updated only afterwards. - improved the photo view gallery to include the index in the loadingBuilder callback - loading original assets from device removed many thumbnails from the cache because originals are huge - build a custom ImageCache that distinguishes between original images from local device and all other images. it uses two different caches internally (one for large originals, one for all others) - implemented a custom ImageProvider for faster loading of originals from the device ## required testing There are some scenarios I cannot test. Somebody else please test - iOS - viewing heic/heif images from device - viewing LivePhotos from device --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 14:18:26 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#10247