Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

The changes documented here do not include those from the original repository.

## [Unreleased]
## [1.2.1]

### 20205-08-18

- Make MLKit scanner initialization lazy to prevent memory consumption overload (https://outsystemsrd.atlassian.net/browse/RMET-3481)

### 2025-06-24

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.ionic.libs</groupId>
<artifactId>ionbarcode-android</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class OSBARCMLKitHelper: OSBARCMLKitHelperInterface {
private const val LOG_TAG = "OSBARCMLKitHelper"
}

private val scanner by lazy {
val options = BarcodeScannerOptions.Builder()
.enableAllPotentialBarcodes()
.build()
BarcodeScanning.getClient(options)
}

/**
* Scans an image looking for barcodes, using the ML Kit library.
* @param imageProxy - ImageProxy object that represents the image to be analyzed.
Expand All @@ -31,10 +38,6 @@ class OSBARCMLKitHelper: OSBARCMLKitHelperInterface {
onSuccess: (MutableList<Barcode>) -> Unit,
onError: () -> Unit
) {
val options = BarcodeScannerOptions.Builder()
.enableAllPotentialBarcodes()
.build()
val scanner = BarcodeScanning.getClient(options)
val image = InputImage.fromBitmap(
imageBitmap,
imageProxy.imageInfo.rotationDegrees
Expand Down
Loading