Skip to content

Commit a309535

Browse files
committed
do not swap dimensions on MacOS
1 parent 66a3b65 commit a309535

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

darwin/mobile_scanner/Sources/mobile_scanner/MobileScannerPlugin.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,12 +410,14 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler,
410410
var width = Double(dimensions.width)
411411
var height = Double(dimensions.height)
412412

413+
#if os(iOS)
413414
// Swap width and height if the image is in portrait mode
414415
if orientation == AVCaptureVideoOrientation.portrait || orientation == AVCaptureVideoOrientation.portraitUpsideDown {
415416
let temp = width
416417
width = height
417418
height = temp
418419
}
420+
#endif
419421

420422
let size = ["width": width, "height": height]
421423

0 commit comments

Comments
 (0)