Skip to content

Commit

Permalink
do not swap dimensions on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
navaronbracke committed Oct 23, 2024
1 parent 66a3b65 commit a309535
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit a309535

Please sign in to comment.