mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-25 19:29:54 +01:00
Fix QR scanning issues.
This commit is contained in:
committed by
Alex Hart
parent
019025ab8a
commit
eefd7bd37a
@@ -45,6 +45,8 @@ class QrProcessor {
|
||||
previousHeight = source.height
|
||||
}
|
||||
|
||||
listener?.invoke(source)
|
||||
|
||||
val bitmap = BinaryBitmap(HybridBinarizer(source))
|
||||
val result: Result? = reader.decode(bitmap, mapOf(DecodeHintType.TRY_HARDER to true, DecodeHintType.CHARACTER_SET to "ISO-8859-1"))
|
||||
|
||||
@@ -65,5 +67,7 @@ class QrProcessor {
|
||||
|
||||
companion object {
|
||||
private val TAG = Log.tag(QrProcessor::class.java)
|
||||
|
||||
var listener: ((LuminanceSource) -> Unit)? = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ internal class ScannerView21 constructor(
|
||||
val preview = Preview.Builder().build()
|
||||
|
||||
val imageAnalysis = ImageAnalysis.Builder()
|
||||
.setTargetResolution(Size(1920, 1080))
|
||||
.setTargetResolution(Size(1280, 960))
|
||||
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
|
||||
.build()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user