Showing
1 changed file
with
3 additions
and
1 deletions
| @@ -458,7 +458,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -458,7 +458,7 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 458 | let argReader = MapArgumentReader(call.arguments as? [String: Any]) | 458 | let argReader = MapArgumentReader(call.arguments as? [String: Any]) |
| 459 | let symbologies:[VNBarcodeSymbology] = argReader.toSymbology() | 459 | let symbologies:[VNBarcodeSymbology] = argReader.toSymbology() |
| 460 | 460 | ||
| 461 | - guard let fileUrl: URL = URL(string: argReader.string(key: "filePath") ?? "") else { | 461 | + guard let filePath: String = argReader.string(key: "filePath") else { |
| 462 | // TODO: fix error code | 462 | // TODO: fix error code |
| 463 | result(FlutterError(code: "MobileScanner", | 463 | result(FlutterError(code: "MobileScanner", |
| 464 | message: "No image found in analyzeImage!", | 464 | message: "No image found in analyzeImage!", |
| @@ -466,6 +466,8 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | @@ -466,6 +466,8 @@ public class MobileScannerPlugin: NSObject, FlutterPlugin, FlutterStreamHandler, | ||
| 466 | return | 466 | return |
| 467 | } | 467 | } |
| 468 | 468 | ||
| 469 | + let fileUrl = URL(fileURLWithPath: filePath) | ||
| 470 | + | ||
| 469 | guard let ciImage = CIImage(contentsOf: fileUrl) else { | 471 | guard let ciImage = CIImage(contentsOf: fileUrl) else { |
| 470 | // TODO: fix error code | 472 | // TODO: fix error code |
| 471 | result(FlutterError(code: "MobileScanner", | 473 | result(FlutterError(code: "MobileScanner", |
-
Please register or login to post a comment