From 67e0932f223409a452a78048e36c37623f46d1c4 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Wed, 23 Oct 2024 09:56:20 +0200 Subject: [PATCH 1/3] fix formats for analyze image --- lib/src/mobile_scanner_controller.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/src/mobile_scanner_controller.dart b/lib/src/mobile_scanner_controller.dart index e4edd86b4..6b2d718dc 100644 --- a/lib/src/mobile_scanner_controller.dart +++ b/lib/src/mobile_scanner_controller.dart @@ -186,6 +186,8 @@ class MobileScannerController extends ValueNotifier { /// Analyze an image file. /// /// The [path] points to a file on the device. + /// The [formats] specify the barcode formats that should be detected in the image. + /// If the [formats] are omitted or empty, all formats are detected. /// /// This is only supported on Android, iOS and MacOS. /// @@ -193,8 +195,11 @@ class MobileScannerController extends ValueNotifier { /// /// If an error occurred during the analysis of the image, /// a [MobileScannerBarcodeException] error is thrown. - Future analyzeImage(String path) { - return MobileScannerPlatform.instance.analyzeImage(path); + Future analyzeImage( + String path, { + List formats = const [], + }) { + return MobileScannerPlatform.instance.analyzeImage(path, formats: formats); } /// Build a camera preview widget. From 20527c833f23c342cb12b95f9ea52bcb0ff9d0ff Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Wed, 23 Oct 2024 10:06:55 +0200 Subject: [PATCH 2/3] exclude arm64 simulators --- README.md | 4 ++++ ios/mobile_scanner.podspec | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e724be17..efb795f7f 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ dev.steenbakker.mobile_scanner.useUnbundled=true ``` ### iOS + +_iOS arm64 Simulators are currently not yet supported, until the migration to the Vision API is complete._ +_See_ https://github.com/juliansteenbakker/mobile_scanner/issues/1225 + **Add the following keys to your Info.plist file, located in /ios/Runner/Info.plist:** NSCameraUsageDescription - describe why your app needs access to the camera. This is called Privacy - Camera Usage Description in the visual editor. diff --git a/ios/mobile_scanner.podspec b/ios/mobile_scanner.podspec index 832f6c652..668914159 100644 --- a/ios/mobile_scanner.podspec +++ b/ios/mobile_scanner.podspec @@ -21,7 +21,8 @@ An universal scanner for Flutter based on MLKit. # Flutter.framework does not contain a i386 slice, and MLKit does not support armv7. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', - 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 armv7', + # TODO: add back arm64 (and armv7?) when switching to the Vision API. + 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 armv7 arm64', 'EXCLUDED_ARCHS[sdk=iphoneos*]' => 'armv7', } s.swift_version = '5.0' From cbbb133dcaec2e59d07b19de559383323726dae0 Mon Sep 17 00:00:00 2001 From: Navaron Bracke Date: Wed, 23 Oct 2024 10:07:16 +0200 Subject: [PATCH 3/3] bump version --- CHANGELOG.md | 8 ++++++++ ios/mobile_scanner.podspec | 2 +- macos/mobile_scanner.podspec | 2 +- pubspec.yaml | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 128e29fd0..5685aaead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 6.0.2 + +Bugs fixed: +* Fixed a bug that prevented `analyzeImage` from actually accepting the configured formats. + +Improvements: +* [iOS] Excluded the `arm64` architecture for Simulators, which is unsupported by MLKit 7.0.0. + ## 6.0.1 Bugs fixed: diff --git a/ios/mobile_scanner.podspec b/ios/mobile_scanner.podspec index 668914159..e5da058a8 100644 --- a/ios/mobile_scanner.podspec +++ b/ios/mobile_scanner.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'mobile_scanner' - s.version = '6.0.1' + s.version = '6.0.2' s.summary = 'An universal scanner for Flutter based on MLKit.' s.description = <<-DESC An universal scanner for Flutter based on MLKit. diff --git a/macos/mobile_scanner.podspec b/macos/mobile_scanner.podspec index 2fbf0360e..1aa906528 100644 --- a/macos/mobile_scanner.podspec +++ b/macos/mobile_scanner.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'mobile_scanner' - s.version = '6.0.1' + s.version = '6.0.2' s.summary = 'An universal scanner for Flutter based on MLKit.' s.description = <<-DESC An universal scanner for Flutter based on MLKit. diff --git a/pubspec.yaml b/pubspec.yaml index 1255535e2..588e6e507 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mobile_scanner description: A universal barcode and QR code scanner for Flutter based on MLKit. Uses CameraX on Android, AVFoundation on iOS and Apple Vision & AVFoundation on macOS. -version: 6.0.1 +version: 6.0.2 repository: https://github.com/juliansteenbakker/mobile_scanner screenshots: