-
-
Notifications
You must be signed in to change notification settings - Fork 625
fix: handle errors from cvcreatepixelbuffer #1564
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: handle errors from cvcreatepixelbuffer #1564
Conversation
| // FlutterTexture | ||
| public func copyPixelBuffer() -> Unmanaged<CVPixelBuffer>? { | ||
| if latestBuffer == nil { | ||
| guard let buffer = latestBuffer else { |
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.
Just in case, also use a guard let here
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1564 +/- ##
===========================================
- Coverage 38.45% 38.35% -0.11%
===========================================
Files 42 42
Lines 996 996
===========================================
- Hits 383 382 -1
- Misses 613 614 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| func updateScanWindow(_ call: FlutterMethodCall, _ result: @escaping FlutterResult) { | ||
| let argReader = MapArgumentReader(call.arguments as? [String: Any]) | ||
| let scanWindowData: Array? = argReader.floatArray(key: "rect") | ||
| let scanWindowData: [CGFloat]? = argReader.floatArray(key: "rect") |
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 was indeed [CGFloat]? in the arg reader
|
|
||
| DispatchQueue.main.async { | ||
| // If the image is nil, use zero as the size. | ||
| guard let image = cgImage else { |
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 check is no longer needed
|
@juliansteenbakker I would like to release this as the definitive |
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.
Looks good to me. Tested on iPhone, and did not see any difference with current version.
Fixes #1545