Skip to content
This repository was archived by the owner on Jun 14, 2022. It is now read-only.

Conversation

ziegenberg
Copy link
Contributor

@ziegenberg ziegenberg commented Mar 16, 2021

Try decoding the image multiple times with different decoding hints and update dependency ZXing to version 3.4.1. to FIX #790.

Note: Although the documentation says that from com.google.zxing:core version 3.4.0 and later Java 8, which requires targeting API level 24 or later, is required, using Java 8 desugaring is a possible solution. For details see: https://developer.android.com/studio/write/java8-support

Java 8 desugaring was enabled for andOTP with #544 (commit df6c7cd) and is available since 0.8.0.

I tested this with the Android emulator on API Level 22 and 30.

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
- use QRCodeReader instead of MultiFormatReader
- use decoding hints with BarcodeFormat.QR_CODE
- try a second time with DecodeHintType.TRY_HARDER

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
- update com.google.zxing:core to 3.4.1

Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
@flocke flocke added the bug label Mar 17, 2021
@flocke flocke added this to the v0.8.1 milestone Mar 17, 2021
@flocke flocke self-requested a review March 17, 2021 04:40
Copy link
Member

@flocke flocke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it as well on some AVDs and it works as expected, even on SDKs below 24.

@flocke flocke merged commit 780b880 into andOTP:master Mar 17, 2021
@ziegenberg ziegenberg deleted the 790-qr-code-not-found-in-image-file branch July 10, 2021 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't scan qr code from image file
2 participants