Make scanner try harder

This commit is contained in:
世界 2020-12-30 17:33:28 +08:00
parent 8997e7202a
commit f29410f6a2
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4
1 changed files with 6 additions and 2 deletions

View File

@ -469,9 +469,13 @@ object ProxyUtil {
try { try {
val result = try { val result = try {
qrReader.decode(BinaryBitmap(GlobalHistogramBinarizer(source))) qrReader.decode(BinaryBitmap(GlobalHistogramBinarizer(source)), mapOf(
DecodeHintType.TRY_HARDER to true
))
} catch (e: NotFoundException) { } catch (e: NotFoundException) {
qrReader.decode(BinaryBitmap(GlobalHistogramBinarizer(source.invert()))) qrReader.decode(BinaryBitmap(GlobalHistogramBinarizer(source.invert())), mapOf(
DecodeHintType.TRY_HARDER to true
))
} }
showLinkAlert(ctx, result.text) showLinkAlert(ctx, result.text)