### Objective-C Usage Example Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/README.md Provides an example of how to use WeScan in an Objective-C project. This involves creating a bridging header, importing the necessary headers, and presenting the ImageScannerController. Ensure you have added WeScan to your project. ```objective-c // In your Objective-C class: // Import the bridging header if you created one // #import "-Swift.h" // Declare the class @class ImageScannerController; // Example Implementation - (void)presentScanner { ImageScannerController *scannerViewController = [[ImageScannerController alloc] init]; // Set the delegate if needed (requires bridging header setup) // scannerViewController.imageScannerDelegate = self; [self presentViewController:scannerViewController animated:YES completion:nil]; } ``` -------------------------------- ### Swift Package Manager Installation Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/README.md Instructions for adding WeScan as a dependency to your Swift package using Swift Package Manager. This is the recommended method for integrating the library into your iOS project. ```swift dependencies: [ .package(url: "https://github.com/WeTransfer/WeScan.git", .upToNextMajor(from: "2.1.0")) ] ``` -------------------------------- ### Cloning and Setting Up Repository Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/CONTRIBUTING.md Steps to fork, clone the repository, and set up upstream remote for contributing. ```bash git clone git@github.com:YOUR_USERNAME/WeScan.git cd WeScan git remote add upstream git@github.com:WeTransfer/WeScan.git ``` -------------------------------- ### Version 1.4.0 Updates Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/Changelog.md This version marks a migration to Bitrise for CI/CD and incorporates Danger-Swift for code review automation. ```swift // Migrate to Bitrise & Danger-Swift ``` -------------------------------- ### Creating a New Topic Branch Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/CONTRIBUTING.md Instructions for creating a new branch for your feature, change, or fix. ```bash git checkout -b ``` -------------------------------- ### Native Implementation References Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Provides links to native libraries used for implementing edge detection on mobile platforms. These references are valuable for developers looking to integrate similar functionality. ```References https://github.com/WeTransfer/WeScan https://github.com/KePeng1019/SmartPaperScan ``` -------------------------------- ### Flutter Project Dependencies Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Lists the dependencies required for the Flutter project, including edge_detection, permission_handler, path_provider, and path. ```yaml dependencies: flutter: sdk: flutter edge_detection: ^1.1.3 permission_handler: ^10.0.0 path_provider: ^2.0.11 path: ^1.8.2 ``` -------------------------------- ### Pushing Topic Branch Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/CONTRIBUTING.md Command to push your local topic branch to your forked repository. ```bash git push origin ``` -------------------------------- ### iOS Build Configuration (Permission Handler) Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Configures build settings for iOS to handle camera and photos permissions using the permission_handler plugin. ```gradle post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ '$(inherited)', ## dart: PermissionGroup.camera 'PERMISSION_CAMERA=1', ## dart: PermissionGroup.photos 'PERMISSION_PHOTOS=1', ] end # End of the permission_handler configuration end end ``` -------------------------------- ### Updating Local Repository Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/CONTRIBUTING.md How to fetch the latest changes from the upstream repository into your local development branch. ```bash git checkout git pull upstream ``` -------------------------------- ### Version 1.3.0 Updates Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/Changelog.md This update includes updated SwiftLint code style rules and enforces changelog entries through CI. ```swift // Updated SwiftLint code style rules // Forcing a changelog entry now from CI ``` -------------------------------- ### Project Version History and Changes Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/Changelog.md This section details the changes made in different versions of the edge detection project. It includes bug fixes, feature enhancements, and dependency updates, referencing specific GitHub pull requests and contributors. ```markdown ### 3.0.0-beta.1 - Copy snapshots to test bundle to solve SPM warning ([#363](https://github.com/WeTransfer/WeScan/pull/363)) via [@valeriyvan](https://github.com/valeriyvan) - Fix typo ([#362](https://github.com/WeTransfer/WeScan/pull/362)) via [@valeriyvan](https://github.com/valeriyvan) - Remove deprecated properties ([#360](https://github.com/WeTransfer/WeScan/pull/360)) via [@valeriyvan](https://github.com/valeriyvan) - Fix typos ([#357](https://github.com/WeTransfer/WeScan/pull/357)) via [@valeriyvan](https://github.com/valeriyvan) - Merge release 2.1.0 into master ([#352](https://github.com/WeTransfer/WeScan/pull/352)) via [@wetransferplatform](https://github.com/wetransferplatform) ### 2.1.0 - Update CI module to fix CI ([#351](https://github.com/WeTransfer/WeScan/pull/351)) via [@AvdLee](https://github.com/AvdLee) - Fix resetMatchingScores ([#349](https://github.com/WeTransfer/WeScan/pull/349)) via [@lengocgiang](https://github.com/lengocgiang) - Update CODEOWNERS ([#343](https://github.com/WeTransfer/WeScan/pull/343)) via [@peagasilva](https://github.com/peagasilva) - Merge release 2.0.0 into master ([#342](https://github.com/WeTransfer/WeScan/pull/342)) via [@wetransferplatform](https://github.com/wetransferplatform) ### 2.0.0 - Fixed SwiftUI Previews in Xcode >= 14 ([#338](https://github.com/WeTransfer/WeScan/pull/338)) via [@amarildolucas](https://github.com/amarildolucas) - Update CI to latest ([#339](https://github.com/WeTransfer/WeScan/pull/339)) via [@AvdLee](https://github.com/AvdLee) ### 1.8.1 - Fix broken iOS 14 AV apple api ([#293](https://github.com/WeTransfer/WeScan/pull/293)) via [@ErikGro](https://github.com/ErikGro) - ! add japan language ([#281](https://github.com/WeTransfer/WeScan/pull/281)) via [@padgithub](https://github.com/padgithub) - Localization - Add support for Dutch language ([#285](https://github.com/WeTransfer/WeScan/pull/285)) via [@marvukusic](https://github.com/marvukusic) - Fix tests, update to use the iPhone 12 simulator. ([#290](https://github.com/WeTransfer/WeScan/pull/290)) via [@AvdLee](https://github.com/AvdLee) - Merge release 1.8.0 into master ([#280](https://github.com/WeTransfer/WeScan/pull/280)) via [@wetransferplatform](https://github.com/wetransferplatform) ### 1.8.0 - SPM Support ([#172](https://github.com/WeTransfer/WeScan/issues/172)) via [@AvdLee](https://github.com/AvdLee) - Typo fix in the comment ([#272](https://github.com/WeTransfer/WeScan/pull/272)) via [@PermanAtayev](https://github.com/PermanAtayev) - Realign table of contents and rest of the README ([#271](https://github.com/WeTransfer/WeScan/pull/271)) via [@jacquerie](https://github.com/jacquerie) - Feat: added Arabic language support ([#267](https://github.com/WeTransfer/WeScan/pull/267)) via [@mohammadhamdan1991](https://github.com/mohammadhamdan1991) - Czech language support ([#259](https://github.com/WeTransfer/WeScan/pull/259)) via [@killalad](https://github.com/killalad) - Merge release 1.7.0 into master ([#256](https://github.com/WeTransfer/WeScan/pull/256)) via [@ghost](https://github.com/ghost) ### 1.7.0 - Create individual Scanner and Review image controller ([#213](https://github.com/WeTransfer/WeScan/pull/213)) via [@chawatvish](https://github.com/chawatvish) - Merge release 1.6.0 into master ([#254](https://github.com/WeTransfer/WeScan/pull/254)) via [@WeTransferBot](https://github.com/WeTransferBot) ``` -------------------------------- ### Version 1.0 Features Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/Changelog.md The initial release (1.0) introduced support for multiple languages (French, Italian, Portuguese, Chinese Simplified/Traditional), enhanced image scanning using Adaptive Thresholding, updated to Swift 4.2, and added auto-rotate, auto-scan, and Vision framework support. ```swift // Add support for French, Italian, Portuguese, Chinese (Simplified) and Chinese (Traditional) // Add support to enhance the scanned image using AdaptiveThresholding // Updated to Swift 4.2 // Add auto rotate, auto scan, and Vision support ``` -------------------------------- ### Version 1.6.0 Updates Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/Changelog.md This version introduces support for using an image after instantiation, integrates SF Symbols, and refines UI elements like the cancel button and yellow tint color. It also includes various bug fixes and localization updates for Russian and Turkish. ```swift // Allow support for using an image after instantiation // SF Symbols integration // Use same yellow tint color // Update cancel button title // Fix error description typo // Update EditScanViewController.swift // Update Localizable.strings // Update ReviewViewController.swift // Safe assignment of the AVCaptureSession preset value // Added delegate argument to class CaptureSessionManager init // Trivial marker typo fix // Add Russian language support // Turkish localization added // Re-scale height independently in Quadrilateral CGAffineTransform ``` -------------------------------- ### Version 1.5.0 Updates Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/Changelog.md This release focuses on internationalization with Polish and Spanish (ES and LATAM) translations. It also includes improvements to the Xcode project and updates the README to address initial configuration issues. ```swift // Update xcode project - include polish translation - improvements // Create polish localization // ES and LATAM spanish translations // Updated the readme to avoid some small initial configuration issues. ``` -------------------------------- ### Version 1.1.0 Updates Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/Changelog.md This version updates the project to Swift 5.0, adds German translation support, and includes several minor improvements. ```swift // Updated to Swift 5.0 // Added German translation // Several small improvements ``` -------------------------------- ### Android Minimum SDK Version Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Sets the minimum Android SDK version to 21 in the `android/app/build.gradle` file. ```gradle minSdkVersion 21 ``` -------------------------------- ### Edge Detection from Gallery Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Checks camera permissions, generates a file path, and performs edge detection by selecting an image directly from the gallery. ```dart // Check permissions and request its bool isCameraGranted = await Permission.camera.request().isGranted; if (!isCameraGranted) { isCameraGranted = await Permission.camera.request() == PermissionStatus.granted; } if (!isCameraGranted) { // Have not permission to camera return; } // Generate filepath for saving String imagePath = join((await getApplicationSupportDirectory()).path, "${(DateTime.now().millisecondsSinceEpoch / 1000).round()}.jpeg"); // Use below code for selecting directly from the gallery. try { //Make sure to await the call to detectEdgeFromGallery. bool success = await EdgeDetection.detectEdgeFromGallery(imagePath, androidCropTitle: 'Crop', // use custom localizations for android androidCropBlackWhiteTitle: 'Black White', androidCropReset: 'Reset', ); } catch (e) { print(e); } ``` -------------------------------- ### iOS Info.plist Permissions Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Specifies necessary privacy permissions for camera and photo library usage in the `Info.plist` file. ```xml NSCameraUsageDescription Can I use the camera please? NSPhotoLibraryUsageDescription Can I use the photos please? NSPhotoLibraryAddUsageDescription Can I use the photos please? ``` -------------------------------- ### Merging Upstream Changes Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/CONTRIBUTING.md How to integrate changes from the upstream development branch into your topic branch. ```bash git pull [--rebase] upstream ``` -------------------------------- ### Edge Detection from Live Camera Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Checks camera permissions, generates a file path, and performs edge detection using the live camera feed. Allows selecting images from the gallery within the camera interface. ```dart // Check permissions and request its bool isCameraGranted = await Permission.camera.request().isGranted; if (!isCameraGranted) { isCameraGranted = await Permission.camera.request() == PermissionStatus.granted; } if (!isCameraGranted) { // Have not permission to camera return; } // Generate filepath for saving String imagePath = join((await getApplicationSupportDirectory()).path, "${(DateTime.now().millisecondsSinceEpoch / 1000).round()}.jpeg"); // Use below code for live camera detection with option to select from gallery in the camera feed. try { //Make sure to await the call to detectEdge. bool success = await EdgeDetection.detectEdge(imagePath, canUseGallery: true, androidScanTitle: 'Scanning', // use custom localizations for android androidCropTitle: 'Crop', androidCropBlackWhiteTitle: 'Black White', androidCropReset: 'Reset', ); } catch (e) { print(e); } ``` -------------------------------- ### Swift Usage: ImageScannerControllerDelegate Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/README.md Demonstrates how to use WeScan in Swift by conforming to the ImageScannerControllerDelegate protocol. This includes handling scanning results, errors, and cancellations. You need to import WeScan and set the delegate for the ImageScannerController. ```swift import WeScan class YourViewController: UIViewController, ImageScannerControllerDelegate { // YourViewController code here func imageScannerController(_ scanner: ImageScannerController, didFailWithError error: Error) { // Handle the error print(error) } func imageScannerController(_ scanner: ImageScannerController, didFinishScanningWithResults results: ImageScannerResults) { // Process the scanned image results scanner.dismiss(animated: true) } func imageScannerControllerDidCancel(_ scanner: ImageScannerController) { // Handle cancellation scanner.dismiss(animated: true) } // Present the scanner func presentScanner() { let scannerViewController = ImageScannerController() scannerViewController.imageScannerDelegate = self present(scannerViewController, animated: true) } } ``` -------------------------------- ### Android Kotlin Version Configuration Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Sets the Kotlin version to 1.8.0 in the `android/build.gradle` file for Android project compilation. ```gradle ext.kotlin_version = '1.8.0' ``` -------------------------------- ### iOS Xcode 15 Build Fix (WeScan Dependency) Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Adds the WeScan dependency to the Podfile for fixing build issues on Xcode 15. ```gradle target 'Runner' do use_frameworks! use_modular_headers! pod 'WeScan', :path => '.symlinks/plugins/edge_detection/ios/WeScan-3.0.0' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end ``` -------------------------------- ### Android Edge Detection Screenshots Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Displays screenshots of the edge detection functionality on the Android platform. These images illustrate the visual output of the edge detection algorithm in action. ```Android
``` -------------------------------- ### Dart Import Statement Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Imports the edge_detection plugin into your Dart code. ```dart import 'package:edge_detection/edge_detection.dart'; ``` -------------------------------- ### iOS Edge Detection Screenshots Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/README.md Presents screenshots of the edge detection functionality on the iOS platform. These images highlight the visual results of the edge detection process on iOS devices. ```iOS
``` -------------------------------- ### Commit Message Conventions Source: https://github.com/sawankumarbundelkhandi/edge_detection/blob/master/ios/WeScan-3.0.0/CONTRIBUTING.md Standard formats for commit messages to indicate the type of change (feature, fix, refactor). ```bash git commit -m "feat: message about this feature" ``` ```bash git commit -m "fix: message about this update" ``` ```bash git commit -m "refactor: message about this" -m "BREAKING CHANGE: message about the breaking change" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.