1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

perf(mobile): remove load of thumbnails in the image provider (#17773)

Remove loading of thumbnail in the image provider

* Removed the load of the thumbnail from the local and remote image provider as they shall provide the image, not the thumbnail. The thumbnail gets provided by the thumbnail provider.
* The thumbnail provider is used as the loadingBuilder and the image provider as the imageProvider. Therefore loading the thumbnail in the image provider loads it a second time which is completely redundant, uses precious time and yields no results.

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Toni
2025-04-23 15:55:51 +02:00
committed by GitHub
parent bc5875ba8d
commit 1de2eae12d
2 changed files with 3 additions and 39 deletions

View File

@ -57,12 +57,6 @@ class ImmichRemoteImageProvider
AppSettingsEnum.loadOriginal.defaultValue,
);
/// Whether to load the preview thumbnail first or not
bool get _loadPreview => Store.get(
AppSettingsEnum.loadPreview.storeKey,
AppSettingsEnum.loadPreview.defaultValue,
);
// Streams in each stage of the image as we ask for it
Stream<ui.Codec> _codec(
ImmichRemoteImageProvider key,
@ -70,21 +64,6 @@ class ImmichRemoteImageProvider
ImageDecoderCallback decode,
StreamController<ImageChunkEvent> chunkEvents,
) async* {
// Load a preview to the chunk events
if (_loadPreview) {
final preview = getThumbnailUrlForRemoteId(
key.assetId,
type: api.AssetMediaSize.thumbnail,
);
yield await ImageLoader.loadImageFromCache(
preview,
cache: cache,
decode: decode,
chunkEvents: chunkEvents,
);
}
// Load the higher resolution version of the image
final url = getThumbnailUrlForRemoteId(
key.assetId,