Skip to content

armgit / ente

Public Imported from GitHub
0

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

Do video rotation correction only on Android since the bug is absent on iOS

ashilkna9bf825dde43
diff --git a/mobile/lib/ui/tools/editor/video_editor_page.dart b/mobile/lib/ui/tools/editor/video_editor_page.dart
index f5068ff7cd..a083821ada 100644
--- a/mobile/lib/ui/tools/editor/video_editor_page.dart
+++ b/mobile/lib/ui/tools/editor/video_editor_page.dart
@@ -50,7 +50,7 @@ class _VideoEditorPageState extends State<VideoEditorPage> {
final _logger = Logger("VideoEditor");
/// Some videos have a 'rotation' property in exif that is not 0 which
- /// causes the video to appear rotated in the video editor preview.
+ /// causes the video to appear rotated in the video editor preview on Andoird.
/// This variable is used as a workaround to rotate the video back to its
/// expected orientation.
int? _quarterTurnsForRotationCorrection;
@@ -93,14 +93,7 @@ class _VideoEditorPageState extends State<VideoEditorPage> {
);
});
- getVideoPropsAsync(widget.ioFile).then((props) async {
- if (props?.rotation != null) {
- _quarterTurnsForRotationCorrection = -(props!.rotation! / 90).round();
- } else {
- _quarterTurnsForRotationCorrection = 0;
- }
- setState(() {});
- });
+ _doRotationCorrectionIfAndroid();
}
@override
@@ -346,4 +339,19 @@ class _VideoEditorPageState extends State<VideoEditorPage> {
await PhotoManager.startChangeNotify();
}
}
+
+ void _doRotationCorrectionIfAndroid() {
+ if (Platform.isAndroid) {
+ getVideoPropsAsync(widget.ioFile).then((props) async {
+ if (props?.rotation != null) {
+ _quarterTurnsForRotationCorrection = -(props!.rotation! / 90).round();
+ } else {
+ _quarterTurnsForRotationCorrection = 0;
+ }
+ setState(() {});
+ });
+ } else {
+ _quarterTurnsForRotationCorrection = 0;
+ }
+ }
}