Skip to content

armgit / ente

Public Imported from GitHub
0

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

Fix video rotation bounds calculation for metadata-rotated videos

Prateek Sunal79eff7c516ca
diff --git a/mobile/packages/native_video_editor/ios/Classes/NativeVideoEditorPlugin.swift b/mobile/packages/native_video_editor/ios/Classes/NativeVideoEditorPlugin.swift
index 53abb8bf87..5d5e2512f2 100644
--- a/mobile/packages/native_video_editor/ios/Classes/NativeVideoEditorPlugin.swift
+++ b/mobile/packages/native_video_editor/ios/Classes/NativeVideoEditorPlugin.swift
@@ -305,7 +305,8 @@ public class NativeVideoEditorPlugin: NSObject, FlutterPlugin {
}
// Use bounds testing to calculate the necessary translation to center the video
- let testRect = CGRect(origin: .zero, size: orientedSize)
+ // Use naturalSize here because transform expects input in natural/file coordinate space
+ let testRect = CGRect(origin: .zero, size: naturalSize)
let finalBounds = testRect.applying(transform)
// Center the video in the renderSize
@@ -706,7 +707,8 @@ public class NativeVideoEditorPlugin: NSObject, FlutterPlugin {
}
// Use bounds testing to calculate the necessary translation to center the video
- let testRect = CGRect(origin: .zero, size: orientedSize)
+ // Use naturalSize here because transform expects input in natural/file coordinate space
+ let testRect = CGRect(origin: .zero, size: naturalSize)
let finalBounds = testRect.applying(transform)
// Center the video in the renderSize