Monero-gui: QR-code on black background is difficult to scan

Created on 4 Apr 2018  路  8Comments  路  Source: monero-project/monero-gui

GUI version: v0.12.0.0

OS: macOS 10.13.1

Reproducibility: Always

Steps:

  1. Open GUI to 'receive' section.

  2. Scan QR code.

Issue: The QR code cannot be scanned by most QR code scanning software because it is on a black background without border. To mitigate, add a white border around the QR code.

Expected result: QR code scans and produces proper address.

bug

All 8 comments

Reproduced using the Windows GUI and Monerujo. Does not scan the QR code.

+bug

I think I found the issue. I haven't looked through the code yet to see where it's happening though. It wouldn't read the code in Monerujo for me either, but it worked fine in a QR code scanner (after a while).

Black background shouldn't matter. QR codes are very resilient to things like that. They'll work with the colors inverted and even with a large portion of the QR code missing (depending on the QR version).

I decoded it into a raw value and compared it to a generated QR code online and the GUI QR code seems to be missing some data.

Text Content (for both)

monero:83yiuYLUk1kdPyPLeNx9S73nFYqjKYtGG8dqEUonmaghMUFjE931BNBNgBggXhGBqxeL99BmXuo6yJwL1SAL8cbEB698TEp

GUI hex values

6d 6f 6e 65 72 6f 3a 38 33 79 69 75 59 4c 55 6b 31 6b 64 50 79 50 4c 65 4e 78 39 53 37 33 6e 46 59 71 6a 4b 59 74 47 47 38 64 71 45 55 6f 6e 6d 61 67 68 4d 55 46 6a 45 39 33 31 42 4e 42 4e 67 42 67 67 58 68 47 42 71 78 65 4c 39 39 42 6d 58 75 6f 36 79 4a 77 4c 31 53 41 4c 38 63 62 45 42 36 39 38 54 45 70
screenshot from 2018-04-04 17-45-50

Generated QR hex values

6d 6f 6e 65 72 6f 3a 38 33 79 69 75 59 4c 55 6b 31 6b 64 50 79 50 4c 65 4e 78 39 53 37 33 6e 46 59 71 6a 4b 59 74 47 47 38 64 71 45 55 6f 6e 6d 61 67 68 4d 55 46 6a 45 39 33 31 42 4e 42 4e 67 42 67 67 58 68 47 42 71 78 65 4c 39 39 42 6d 58 75 6f 36 79 4a 77 4c 31 53 41 4c 38 63 62 45 42 36 39 38 54 45 70 0a
screenshot from 2018-04-04 18-08-30

Diff

0a, which appears to be a LF / Line Feed in Hex. I compared this to some other generators and it's the same result. It's not the QR version/format as I originally thought.

Looking at pages/Receive.qml we find a qrCode image component.

https://github.com/monero-project/monero-gui/blob/76a105261e4ce60555931b4b2dfe1c6a25971825/pages/Receive.qml#L378

It uses makeQRCodeString() to generate a valid qr code string. I debugged this, in my case the output of that javascript function was: monero:A1eTt937UiPG2YznHoejJkLtJbUK21gUML3JHF6K3R8K7hY6Qfwow62brQFnYc2QQeZ6gn1srwtwPAKfxzPMMw7fHDUP1c8, which does not seem to include line feeds (s.indexOf('\x0a') === -1).

I'm guessing the error is somewhere in the C++ code that handles the image://qrcode/... part.

Are both QR codes for primary address and sub addresses broken?

@skftn Yes. Cake refuses to scan subaddress QR codes.

Using white color here solves the problem for me, so adding white margins (about 4px) to the qrcode will do the job.

If @skftn doesn't have time I'll try to implement this before the next release

Same problem in https://www.qrcode-monkey.com with: Black Background+logo_Image+Color_ Gradient+Custom_Eye_Color
Even with a good contrast using only black & white and without an image logo: QR can not be readed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brainscar picture brainscar  路  8Comments

jmgranner picture jmgranner  路  6Comments

GreatWhiteMuffloN picture GreatWhiteMuffloN  路  8Comments

ddyzhang picture ddyzhang  路  8Comments

cdiv1e12 picture cdiv1e12  路  10Comments