Skip to content

armgit / ente

Public Imported from GitHub
0

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

fix(mobile): compute panorama whenever

Prateek Sunal9ca2e1d91f0f
diff --git a/mobile/lib/ui/viewer/file/file_bottom_bar.dart b/mobile/lib/ui/viewer/file/file_bottom_bar.dart
index e3d2eda7a7..c29023ada3 100644
--- a/mobile/lib/ui/viewer/file/file_bottom_bar.dart
+++ b/mobile/lib/ui/viewer/file/file_bottom_bar.dart
@@ -43,12 +43,16 @@ class FileBottomBar extends StatefulWidget {
class FileBottomBarState extends State<FileBottomBar> {
final GlobalKey shareButtonKey = GlobalKey();
bool isPanorama = false;
+ int? lastFile;
Future<void> _checkPanoroma() async {
- if (widget.file.fileType != FileType.image) {
+ if (widget.file.fileType != FileType.image ||
+ lastFile == widget.file.generatedID) {
return;
}
+ lastFile = widget.file.generatedID;
+
final file = await getFile(widget.file);
if (file == null) {
return;
@@ -64,6 +68,7 @@ class FileBottomBarState extends State<FileBottomBar> {
@override
Widget build(BuildContext context) {
+ _checkPanoroma();
return _getBottomBar();
}
diff --git a/mobile/lib/utils/panorama_util.dart b/mobile/lib/utils/panorama_util.dart
index ef68b7e7ac..16e1a41cee 100644
--- a/mobile/lib/utils/panorama_util.dart
+++ b/mobile/lib/utils/panorama_util.dart
@@ -15,5 +15,5 @@ Future<bool> checkIfPanorama(File file) async {
final result = await readExifAsync(file);
final element = result["EXIF CustomRendered"];
- return (element?.printable == "6");
+ return element?.printable == "6";
}