Skip to content

feat(Release v3.1.0-beta.2): Add Image Scanning Functionality with Gallery Access - #70

Merged
pushpender-singh-ap merged 6 commits into
mainfrom
v3.1.0
Jan 29, 2026
Merged

feat(Release v3.1.0-beta.2): Add Image Scanning Functionality with Gallery Access#70
pushpender-singh-ap merged 6 commits into
mainfrom
v3.1.0

Conversation

@pushpender-singh-ap

@pushpender-singh-ap pushpender-singh-ap commented Jan 27, 2026

Copy link
Copy Markdown
Owner

This pull request introduces comprehensive improvements to the @pushpendersingh/react-native-scanner library, focusing on adding support for scanning barcodes from static images (e.g., gallery images), expanding documentation, and enhancing the Android implementation for image scanning. The changes include updates to the README, a new project wiki, and significant additions to the Android native code to support the new feature.

Major new feature:

  • Adds the ability to scan barcodes from static images (gallery, screenshots, etc.) on both Android and iOS, with detailed documentation and implementation.

The most important changes include:


Feature: Image (Gallery) Barcode Scanning

  • Added documentation and usage examples for scanning barcodes from images using the new scanImage(imageUri) method in the BarcodeScanner class, including supported image formats and platform notes. [1] [2]
  • Updated the planned features list to mark "Image Analysis - Support scanning barcodes from gallery images" as completed.

Documentation Improvements

  • Expanded the README with detailed instructions, troubleshooting tips, and platform-specific notes for the new image scanning feature, including permissions required for image pickers. [1] [2] [3] [4] [5] [6] [7]
  • Added a comprehensive WIKI.md file describing the library's architecture, project structure, native implementation details, data flow, types, build system, error handling, and best practices for lifecycle management.

Android Native Implementation Enhancements

  • Refactored and extended CameraManager.kt to include image decoding, orientation handling, and thread management for efficient and robust static image barcode scanning. Introduced constants for bitmap size limits and improved executor thread creation for background tasks. [1] [2] [3] [4]

Minor Improvements

  • Corrected numbering and formatting in the README for clarity and consistency.

📱 Platform Support

  • ✅ iOS
  • ✅ Android

Closes: #65

@pushpender-singh-ap pushpender-singh-ap changed the title Release v3.1.0: Add Image Scanning Functionality with Gallery Access feat(Release v3.1.0): Add Image Scanning Functionality with Gallery Access Jan 27, 2026
@pushpender-singh-ap pushpender-singh-ap changed the title feat(Release v3.1.0): Add Image Scanning Functionality with Gallery Access feat(Release v3.1.0-beta.1): Add Image Scanning Functionality with Gallery Access Jan 27, 2026
@pushpender-singh-ap
pushpender-singh-ap marked this pull request as ready for review January 27, 2026 19:36

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces image scanning functionality to the React Native Scanner library, allowing users to scan QR codes and barcodes from static images selected from the device gallery. This addresses issue #65 which requested support for decoding QR codes from existing images as a fallback for devices with low-quality cameras.

Changes:

  • Added scanImage(imageUri) method to scan barcodes from static images on both iOS and Android platforms
  • Integrated react-native-image-picker dependency for gallery access in the example app
  • Updated documentation (README.md and new WIKI.md) with comprehensive usage examples and API reference
  • Added platform-specific permissions for photo library access (iOS) and media storage (Android)

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/index.tsx Added scanImage static method to BarcodeScanner class
src/NativeReactNativeScanner.ts Extended TurboModule interface with scanImage method signature
src/tests/index.test.tsx Added unit test for image scanning functionality
ios/ReactNativeScanner.mm Implemented Objective-C++ bridge method for scanImage
ios/CameraManager.swift Added image scanning with Vision framework and CIDetector fallback for QR codes
android/src/main/java/.../ReactNativeScannerModule.kt Implemented native module method for image scanning
android/src/main/java/.../CameraManager.kt Added ML Kit-based image scanning with Exif handling and fallback bitmap loading
example/src/App.tsx Integrated gallery picker with image scanning demonstration
example/package.json Added react-native-image-picker dependency
example/ios/ReactNativeScannerExample/Info.plist Added NSPhotoLibraryUsageDescription for iOS photo access
example/ios/ReactNativeScannerExample/PrivacyInfo.xcprivacy Added file timestamp access reason code (3B52.1)
example/android/app/src/main/AndroidManifest.xml Added READ_EXTERNAL_STORAGE and READ_MEDIA_IMAGES permissions
package.json Bumped version to 3.1.0-beta.1
yarn.lock Added [email protected] dependency
WIKI.md New comprehensive project documentation with architecture and API details
README.md Updated with image scanning usage examples and supported formats table
example/ios/Podfile.lock Updated with react-native-image-picker pod dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread android/src/main/java/com/pushpendersingh/reactnativescanner/CameraManager.kt Outdated
Comment thread src/__tests__/index.test.tsx
Comment thread WIKI.md
Comment thread README.md
- Added optional bitmap parameter to processImage for recycling after processing
- Implemented bitmap recycle logic with safety check to avoid double recycling
- Passed bitmap to processImage call to enable cleanup of fallback bitmaps
- Recycled original bitmap after drawing to free memory resources
- Added debug logs for bitmap recycling events to track memory management

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread WIKI.md
Comment thread ios/CameraManager.swift Outdated
Comment thread example/android/app/src/main/AndroidManifest.xml
…ndling

- Add URI scheme validation and path traversal prevention for scanImage
- Android: implement retry logic with progressive resolution scaling
- Android: add proper thread factory and executor lifecycle management
- iOS: ensure callbacks run on MainActor with proper error handling
- iOS: wrap image processing in autoreleasepool for better memory management
- Add comprehensive input validation on TypeScript layer
@pushpender-singh-ap pushpender-singh-ap changed the title feat(Release v3.1.0-beta.1): Add Image Scanning Functionality with Gallery Access feat(Release v3.1.0-beta.2): Add Image Scanning Functionality with Gallery Access Jan 29, 2026
@pushpender-singh-ap
pushpender-singh-ap merged commit e29a2e8 into main Jan 29, 2026
5 of 6 checks passed
@pushpender-singh-ap
pushpender-singh-ap deleted the v3.1.0 branch January 29, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Title: Support decoding QR code from existing images in gallery

2 participants