π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] use file-backed exif source
Neeraj Gupta69c779fe982e
diff --git a/mobile/apps/photos/lib/utils/exif_util.dart b/mobile/apps/photos/lib/utils/exif_util.dartindex 6ba4c7e36b..114e0f482f 100644--- a/mobile/apps/photos/lib/utils/exif_util.dart+++ b/mobile/apps/photos/lib/utils/exif_util.dart@@ -12,6 +12,7 @@ import "package:photos/services/isolated_ffmpeg_service.dart";import "package:photos/services/location_service.dart";import "package:photos/src/rust/api/motion_photo_api.dart";import 'package:photos/utils/file_util.dart';+import 'package:random_access_source/random_access_source.dart';const kDateTimeOriginal = "EXIF DateTimeOriginal";const kImageDateTime = "Image DateTime";@@ -175,9 +176,13 @@ Location? locationFromExif(Map<String, IfdTag> exif) {Future<Map<String, IfdTag>> _readExifArgs(Map<String, dynamic> args) {final file = args["file"] as File;- return file- .readAsBytes()- .then((bytes) => readExifFromBytes(bytes).then(_normalizeExifResult));+ return FileRASource.loadFile(file).then((src) async {+ try {+ return _normalizeExifResult(await readExifFromSource(src));+ } finally {+ await src.close();+ }+ });}Future<Map<String, IfdTag>> readExifAsync(File file) async {diff --git a/mobile/apps/photos/pubspec.lock b/mobile/apps/photos/pubspec.lockindex ecfc20ec34..8016f8e5bf 100644--- a/mobile/apps/photos/pubspec.lock+++ b/mobile/apps/photos/pubspec.lock@@ -2300,7 +2300,7 @@ packages:source: hostedversion: "3.2.2"random_access_source:- dependency: transitive+ dependency: "direct main"description:name: random_access_sourcesha256: "2cb3578e3027d6f7e44a66ec9bf72f5e0b73e9c0e62f4768977a0ed962d08be7"diff --git a/mobile/apps/photos/pubspec.yaml b/mobile/apps/photos/pubspec.yamlindex b405ff4252..c964f853c0 100644--- a/mobile/apps/photos/pubspec.yaml+++ b/mobile/apps/photos/pubspec.yaml@@ -72,7 +72,7 @@ dependencies:path: ../../packages/rustequatable: ^2.0.5event_bus: ^2.0.0- exif_reader: ^4.1.0+ exif_reader: 4.1.0expandable: ^5.0.1expansion_tile_card: ^3.0.0extended_image: ^9.1.0@@ -192,6 +192,7 @@ dependencies:url: https://github.com/ente-io/privacy_screen.gitref: v2-onlypro_image_editor: ^11.3.0+ random_access_source: 4.2.1receive_sharing_intent: # pub.dev is behindgit:url: https://github.com/KasemJaffer/receive_sharing_intent.git