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]