mirror of
https://github.com/immich-app/immich.git
synced 2026-02-09 03:08:53 +03:00
clarify parameter
This commit is contained in:
@@ -35,7 +35,7 @@ abstract class ImageRequest {
|
||||
|
||||
void _onCancelled();
|
||||
|
||||
Future<ui.FrameInfo?> _fromPlatformImage(Map<String, int> info, bool shouldFree) async {
|
||||
Future<ui.FrameInfo?> _fromPlatformImage(Map<String, int> info, {required bool shouldFree}) async {
|
||||
final address = info['pointer'];
|
||||
if (address == null) {
|
||||
return null;
|
||||
|
||||
@@ -24,7 +24,7 @@ class LocalImageRequest extends ImageRequest {
|
||||
isVideo: assetType == AssetType.video,
|
||||
);
|
||||
|
||||
final frame = await _fromPlatformImage(info, true);
|
||||
final frame = await _fromPlatformImage(info, shouldFree: true);
|
||||
return frame == null ? null : ImageInfo(image: frame.image, scale: scale);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class RemoteImageRequest extends ImageRequest {
|
||||
final Map<String, int> info = await remoteImageApi.requestImage(uri, headers: headers, requestId: requestId);
|
||||
|
||||
try {
|
||||
final frame = await _fromPlatformImage(info, Platform.isIOS);
|
||||
final frame = await _fromPlatformImage(info, shouldFree: Platform.isIOS);
|
||||
return frame == null ? null : ImageInfo(image: frame.image, scale: scale);
|
||||
} finally {
|
||||
if (Platform.isAndroid) {
|
||||
|
||||
@@ -12,7 +12,7 @@ class ThumbhashImageRequest extends ImageRequest {
|
||||
}
|
||||
|
||||
final Map<String, int> info = await localImageApi.getThumbhash(thumbhash);
|
||||
final frame = await _fromPlatformImage(info, true);
|
||||
final frame = await _fromPlatformImage(info, shouldFree: true);
|
||||
return frame == null ? null : ImageInfo(image: frame.image, scale: scale);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user