-
-
Notifications
You must be signed in to change notification settings - Fork 532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: do not hang on analyze image if there are no results #1274
fix: do not hang on analyze image if there are no results #1274
Conversation
@@ -665,17 +665,31 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | |||
} | |||
|
|||
guard let barcodes: [VNBarcodeObservation] = request.results as? [VNBarcodeObservation] else { | |||
DispatchQueue.main.async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We apparently forgot these two :(
"name": "barcode", | ||
"data": barcodes.map({ $0.toMap(imageWidth: Int(ciImage.extent.width), imageHeight: Int(ciImage.extent.height), scanWindow: self.scanWindow) }), | ||
]) | ||
DispatchQueue.main.async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a dispatch queue block, just in case (is the only relevant statement that didn't have it)
@@ -29,6 +29,7 @@ | |||
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; | |||
58A22AC50A792ECA6D027507 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 419C3BC9593F6DE903D740F0 /* Pods_RunnerTests.framework */; }; | |||
F209F1436A19CBC32BFFB26A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EEB40B96A6FFC92607527710 /* Pods_Runner.framework */; }; | |||
78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same change for SPM as in #1273 but for MacOS, which I forgot to add.
@@ -5,6 +5,24 @@ | |||
<BuildAction | |||
parallelizeBuildables = "YES" | |||
buildImplicitDependencies = "YES"> | |||
<PreActions> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same change for SPM as in #1273 but for MacOS, which I forgot to add.
Working as intended now on macOS, and thus also on iOS, since both share the same code path for the fix. |
Fixes #1244