Last active
February 11, 2021 20:20
-
-
Save eliasnogueira/d59035a796f9c78669d39a9868af3bcd to your computer and use it in GitHub Desktop.
Code from appium-read-qrcode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static String decodeQRCode(BufferedImage qrCodeImage) { | |
Result result = null; | |
try { | |
LuminanceSource source = new BufferedImageLuminanceSource(qrCodeImage); | |
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); | |
result = new MultiFormatReader().decode(bitmap); | |
} catch (NotFoundException e) { | |
log.error("QRCode not found", e); | |
} | |
return result.getText(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The complete code can be found at https://github.com/eliasnogueira/appium-read-qrcode