Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

small cleanup

laurenspriem6a911fedfe8a
diff --git a/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart b/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart
index f42cf8a23d..d9ea66070e 100644
--- a/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/face_thumbnail_generator.dart
@@ -23,8 +23,8 @@ class FaceThumbnailGenerator extends SuperIsolate {
FaceThumbnailGenerator._privateConstructor();
factory FaceThumbnailGenerator() => instance;
- /// Generates face thumbnails for all [faceBoxes] in [imageData].
- ///
+ /// Generates face thumbnails for all [faceBoxes] in the image at
+ /// [imagePath].
Future<List<Uint8List>> generateFaceThumbnails(
String imagePath,
List<FaceBox> faceBoxes,
diff --git a/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart b/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart
index 2d67817955..267f15726f 100644
--- a/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/ml_computer.dart
@@ -145,7 +145,7 @@ class MLComputer extends SuperIsolate {
);
}
- if (_clipTextVocabPath != null && _clipTextModelPath != null) {
+ if (_clipTextModelPath != null) {
return;
}
diff --git a/mobile/apps/photos/lib/utils/image_decode_util.dart b/mobile/apps/photos/lib/utils/image_decode_util.dart
index 78210f2745..e4c5c15c05 100644
--- a/mobile/apps/photos/lib/utils/image_decode_util.dart
+++ b/mobile/apps/photos/lib/utils/image_decode_util.dart
@@ -10,10 +10,10 @@ Future<Uint8List?> createSafeJpegDecodeFallbackBytes({
required String imagePath,
}) async {
final imageData = await File(imagePath).readAsBytes();
- return createSafeJpegDecodeFallbackBytesFromData(imageData);
+ return _createSafeJpegDecodeFallbackBytesFromData(imageData);
}
-Uint8List? createSafeJpegDecodeFallbackBytesFromData(Uint8List imageData) {
+Uint8List? _createSafeJpegDecodeFallbackBytesFromData(Uint8List imageData) {
try {
final decoded = image.decodeImage(imageData);
if (decoded == null) {
diff --git a/mobile/apps/photos/lib/utils/isolate/super_isolate.dart b/mobile/apps/photos/lib/utils/isolate/super_isolate.dart
index b109ccac6c..28be15a1ca 100644
--- a/mobile/apps/photos/lib/utils/isolate/super_isolate.dart
+++ b/mobile/apps/photos/lib/utils/isolate/super_isolate.dart
@@ -62,16 +62,14 @@ abstract class SuperIsolate {
@pragma('vm:entry-point')
static void _isolateMain(List<dynamic> args) async {
final SendPort mainSendPort = args[0] as SendPort;
- final RootIsolateToken? rootToken = args[1] as RootIsolateToken?;
+ final RootIsolateToken rootToken = args[1] as RootIsolateToken;
Logger.root.level = kDebugMode ? Level.ALL : Level.INFO;
final IsolateLogger isolateLogger = IsolateLogger();
Logger.root.onRecord.listen(isolateLogger.onLogRecordInIsolate);
final receivePort = ReceivePort();
mainSendPort.send(receivePort.sendPort);
- if (rootToken != null) {
- BackgroundIsolateBinaryMessenger.ensureInitialized(rootToken);
- }
+ BackgroundIsolateBinaryMessenger.ensureInitialized(rootToken);
final logger = Logger('SuperIsolate');
logger.info('IsolateMain started');