Skip to content

Commit

Permalink
ocr - bug fix iscaptured handle on status obj detection changed
Browse files Browse the repository at this point in the history
  • Loading branch information
bayu committed Jul 11, 2022
1 parent a208f57 commit 27bd1d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ class CaptureOCRActivity : BaseCameraActivity(), CaptureKtpListener {

//Listener of CaptureKtpListener
override fun onStatusChanged(status: Status) {
if (isCaptured) return
if (status == Status.SCANNING) {
if (isCaptured) return
showPopupHoldScanDialog()
} else {
clearDataCapture()
Expand Down
4 changes: 2 additions & 2 deletions ocr/src/main/java/id/mncinnovation/ocr/ExtractDataOCR.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class ExtractDataOCR(private val context: Context, private val listener: Extract

fun processExtractData(uriList: List<Uri>) {
listener.onStart()
uriList.forEach {
val imageBitmap = BitmapUtils.getBitmapFromContentUri(context.contentResolver, it)
uriList.forEach { uri ->
val imageBitmap = BitmapUtils.getBitmapFromContentUri(context.contentResolver, uri)
?: return
objectDetector.process(InputImage.fromBitmap(imageBitmap, 0))
.addOnSuccessListener { objects ->
Expand Down

0 comments on commit 27bd1d7

Please sign in to comment.