def parse_qr(self, screenshot): data = b64decode(screenshot['data']) image = PixelImage(data, screenshot['width'], screenshot['height']) for qr in qrparse.parse_qr_codes(image, 2): try: return success( credential_data_to_dict( CredentialData.from_uri(qrdecode.decode_qr_data(qr)))) except Exception as e: logger.error('Failed to parse uri', exc_info=e) return failure('failed_to_parse_uri') return failure('no_credential_found')
def parse_qr(self, screenshot): data = b64decode(screenshot["data"]) image = PixelImage(data, screenshot["width"], screenshot["height"]) for qr in qrparse.parse_qr_codes(image, 2): try: return success( credential_data_to_dict( CredentialData.parse_uri(qrdecode.decode_qr_data(qr)) ) ) except Exception as e: logger.error("Failed to parse uri", exc_info=e) return failure("failed_to_parse_uri") return failure("no_credential_found")
def parse_qr(self, screenshot): data = b64decode(screenshot['data']) image = PixelImage(data, screenshot['width'], screenshot['height']) for qr in qrparse.parse_qr_codes(image, 2): return credential_data_to_dict( CredentialData.from_uri(qrdecode.decode_qr_data(qr)))
def parse_qr(self, screenshot): data = b64decode(screenshot['data']) image = PixelImage(data, screenshot['width'], screenshot['height']) for qr in qrparse.parse_qr_codes(image, 2): return parse_uri(qrdecode.decode_qr_data(qr))