From a309535aa814bd23d68b9de063a40b529cab2223 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Wed, 23 Oct 2024 20:59:28 +0200 Subject: [PATCH] do not swap dimensions on MacOS --- .../Sources/mobile_scanner/MobileScannerPlugin.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/darwin/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift b/darwin/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift index 2ad1d4970..97f820bff 100644 --- a/darwin/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift +++ b/darwin/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift @@ -410,12 +410,14 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, var width = Double(dimensions.width) var height = Double(dimensions.height) +#if os(iOS) // Swap width and height if the image is in portrait mode if orientation == AVCaptureVideoOrientation.portrait || orientation == AVCaptureVideoOrientation.portraitUpsideDown { let temp = width width = height height = temp } +#endif let size = ["width": width, "height": height]