Skip to content
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

RMET-3399 OSBarcodeLib-Android - Improve code readability by using higher resolution #27

Merged
merged 12 commits into from
Apr 30, 2024

Conversation

alexgerardojacinto
Copy link
Collaborator

@alexgerardojacinto alexgerardojacinto commented Apr 30, 2024

Description

  • This PR improves the scanning of barcodes and QR codes by using a higher resolution for the image frames that are passed to the scanning libraries (ZXing and MLKit).
    • This includes updating the version of the CameraX library used to androidx.camera:camera-camera2:1.3.0
    • This version of the library provides a method to directly convert ImagreProxy objects to Bitmap objects, and as such we were able to remove the imageProxyToBitmap method.
  • The PR also includes using the decodeWithState method instead of decode when scanning with the ZXing library.
    • We also removed the TRY_HARDER hint, as from our tests we obtained better results without it.
  • The PR also updates the necessary unit tests.

Context

References: https://outsystemsrd.atlassian.net/browse/RMET-3399

Type of changes

  • Fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Refactor (cosmetic changes)
  • Breaking change (change that would cause existing functionality to not work as expected)

Platforms affected

  • Android
  • iOS
  • JavaScript

Tests

Screenshots (if appropriate)

Video showing the barcode from the support case being scanned successfully:

screen-20240430-140755.mp4

Checklist

  • Pull request title follows the format RNMT-XXXX <title>
  • Code follows code style of this project
  • CHANGELOG.md file is correctly updated
  • Changes require an update to the documentation
    • Documentation has been updated accordingly

Merge `development` into `main`
Merge `development` into `main`
RMET-3312 OSBarcodeLib-Android - Prepare release of version `1.1.0`
Context: In order to use version 1.3.0 of the CameraX Library, we need to use at least version 1.4.0 of the Compose Compiler. But to build with MABS 10, we need to use version 1.5.7 of the compose compiler.

References: https://outsystemsrd.atlassian.net/browse/RMET-3399
Context: After testing in multiple devices, this only resulted in slower readings rather than better results.

References: https://outsystemsrd.atlassian.net/browse/RMET-3399
Context: As we'll be able to use version 1.3.0 of the CameraX library, we can now use this the ImageProxy.toBitmap() method instead of using our own method.

References: https://outsystemsrd.atlassian.net/browse/RMET-3399
Context: We're requesting a resolution of 1920x1080 for the frames that will be scanned. If this resolution isn't available on the device, we set the fallback to the closest highest resolution. If that also isn't available, then it will fallback to the closest lower resolution.

References: https://outsystemsrd.atlassian.net/browse/RMET-3399
@alexgerardojacinto alexgerardojacinto changed the title Fix/rmet 3399/improve code readability RMET-3399 OSBarcodeLib-Android - Improve code readability by using higher resolution Apr 30, 2024
@alexgerardojacinto alexgerardojacinto self-assigned this Apr 30, 2024
Copy link

sonarcloud bot commented Apr 30, 2024

@alexgerardojacinto alexgerardojacinto marked this pull request as ready for review April 30, 2024 13:21
@alexgerardojacinto alexgerardojacinto requested a review from a team as a code owner April 30, 2024 13:21
@alexgerardojacinto alexgerardojacinto merged commit ffde556 into development Apr 30, 2024
7 checks passed
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.

5 participants