π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Remove unnecessary thumbnail decoding in V2 video/live photo method
Prateek Sunal6f80375f8cd8
diff --git a/mobile/apps/photos/lib/services/home_widget_service.dart b/mobile/apps/photos/lib/services/home_widget_service.dartindex 1f0d553257..8ecf5bc4d4 100644--- a/mobile/apps/photos/lib/services/home_widget_service.dart+++ b/mobile/apps/photos/lib/services/home_widget_service.dart@@ -357,29 +357,15 @@ class HomeWidgetService {return false;}- // Decode thumbnail to get dimensions- final ui.Image decodedImage = await compute(- _decodeImageInIsolate,- thumbnail,- );-- final width = decodedImage.width.toDouble();- final height = decodedImage.height.toDouble();- final minDimension = width < height ? width : height;- final size = minDimension < THUMBNAIL_SIZE_V2 ? minDimension : THUMBNAIL_SIZE_V2;-- // Clean up decoded image- decodedImage.dispose();-- // Create image provider from thumbnail bytes+ // PhotoManager already returns thumbnail at requested size, no need to decode for dimensionsfinal imageProvider = MemoryImage(thumbnail);// Create widget with imagefinal widget = ClipRRect(borderRadius: BorderRadius.circular(32),child: Container(- width: size,- height: size,+ width: THUMBNAIL_SIZE_V2,+ height: THUMBNAIL_SIZE_V2,decoration: BoxDecoration(color: Colors.black,image: DecorationImage(@@ -393,7 +379,7 @@ class HomeWidgetService {// Render widget using home_widget packageawait hw.HomeWidget.renderFlutterWidget(widget,- logicalSize: Size(size, size),+ logicalSize: const Size(THUMBNAIL_SIZE_V2, THUMBNAIL_SIZE_V2),key: key,);