fix: Only close image once
This commit is contained in:
parent
9600a38398
commit
df32d2c5e9
@ -53,15 +53,11 @@ class CodeScannerPipeline(
|
||||
val inputImage = InputImage.fromMediaImage(image, Orientation.PORTRAIT.toDegrees())
|
||||
scanner.process(inputImage)
|
||||
.addOnSuccessListener { barcodes ->
|
||||
image.close()
|
||||
isBusy = false
|
||||
if (barcodes.isNotEmpty()) {
|
||||
callback.onCodeScanned(barcodes, CodeScannerFrame(inputImage.width, inputImage.height))
|
||||
}
|
||||
}
|
||||
.addOnFailureListener { error ->
|
||||
image.close()
|
||||
isBusy = false
|
||||
callback.onError(error)
|
||||
}
|
||||
.addOnCompleteListener {
|
||||
|
Loading…
Reference in New Issue
Block a user