mirror of
https://github.com/immich-app/immich.git
synced 2026-03-05 16:33:46 -05:00
* feat(mobile): add support for encoded image requests in local and remote image APIs * fix(mobile): handle memory cleanup for cancelled image requests * refactor(mobile): simplify memory management and response handling for encoded image requests * fix(mobile): correct formatting in cancellation check for image requests * Apply suggestion from @mertalev Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com> * refactor(mobile): rename 'encoded' parameter to 'preferEncoded' for clarity in image request APIs * fix(mobile): ensure proper resource cleanup for cancelled image requests * refactor(mobile): streamline codec handling by removing unnecessary descriptor disposal in loadCodec request --------- Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
32 lines
837 B
Dart
32 lines
837 B
Dart
import 'package:pigeon/pigeon.dart';
|
|
|
|
@ConfigurePigeon(
|
|
PigeonOptions(
|
|
dartOut: 'lib/platform/local_image_api.g.dart',
|
|
swiftOut: 'ios/Runner/Images/LocalImages.g.swift',
|
|
swiftOptions: SwiftOptions(includeErrorClass: false),
|
|
kotlinOut:
|
|
'android/app/src/main/kotlin/app/alextran/immich/images/LocalImages.g.kt',
|
|
kotlinOptions: KotlinOptions(package: 'app.alextran.immich.images'),
|
|
dartOptions: DartOptions(),
|
|
dartPackageName: 'immich_mobile',
|
|
),
|
|
)
|
|
@HostApi()
|
|
abstract class LocalImageApi {
|
|
@async
|
|
Map<String, int>? requestImage(
|
|
String assetId, {
|
|
required int requestId,
|
|
required int width,
|
|
required int height,
|
|
required bool isVideo,
|
|
required bool preferEncoded,
|
|
});
|
|
|
|
void cancelRequest(int requestId);
|
|
|
|
@async
|
|
Map<String, int> getThumbhash(String thumbhash);
|
|
}
|