Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob] Store image height and width

Neeraj Guptabdb7ce2f0300
diff --git a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
index 746112b825..a11aa4c32e 100644
--- a/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
+++ b/mobile/lib/services/machine_learning/face_ml/face_ml_service.dart
@@ -681,6 +681,8 @@ class FaceMlService {
result.mlVersion,
error: result.errorOccured ? true : null,
),
+ height: result.faceDetectionImageSize!.height.truncate(),
+ width: result.faceDetectionImageSize!.width.truncate(),
),
);
await FaceMLDataDB.instance.bulkInsertFaces(faces);
diff --git a/mobile/lib/services/machine_learning/file_ml/file_ml.dart b/mobile/lib/services/machine_learning/file_ml/file_ml.dart
index ed6d0eb2f1..cbd706dd79 100644
--- a/mobile/lib/services/machine_learning/file_ml/file_ml.dart
+++ b/mobile/lib/services/machine_learning/file_ml/file_ml.dart
@@ -2,6 +2,8 @@ import "package:photos/face/model/face.dart";
class FileMl {
final int fileID;
+ final int? height;
+ final int? width;
// json: face
final FaceEmbeddings faceEmbedding;
final ClipEmbedding? clipEmbedding;
@@ -11,12 +13,16 @@ class FileMl {
FileMl(
this.fileID,
this.faceEmbedding, {
+ this.height,
+ this.width,
this.clipEmbedding,
});
// toJson
Map<String, dynamic> toJson() => {
'fileID': fileID,
+ 'height': height,
+ 'width': width,
'faceEmbedding': faceEmbedding.toJson(),
'clipEmbedding': clipEmbedding?.toJson(),
};
@@ -25,6 +31,8 @@ class FileMl {
return FileMl(
json['fileID'] as int,
FaceEmbeddings.fromJson(json['faceEmbedding'] as Map<String, dynamic>),
+ height: json['height'] as int?,
+ width: json['width'] as int?,
clipEmbedding: json['clipEmbedding'] == null
? null
: ClipEmbedding.fromJson(