Open tkamiya22 opened 2 months ago
I haven't been able to fix this problem yet, but I've found that the code that QRQR can't recognize has 2 block definitions.
from src.rmqrcode import rMQR, ErrorCorrectionLevel
from src.rmqrcode.format.rmqr_versions import rMQRVersions
def print_table(e: ErrorCorrectionLevel):
rows = [7, 9, 11, 13, 15, 17]
cols = [27, 43, 59, 77, 99, 139]
print('| |' + '|'.join((f'{i:>3}' for i in cols)) + '|')
print('|---|' + '|'.join(('---' for i in rows)) + '|')
for row in rows:
print(f'|R{row:<2}|', end='')
for col in cols:
version = f'R{row}x{col}'
if not rMQR.validate_version(version):
print(' - |', end='')
continue
b = rMQRVersions[version]['blocks'][e]
print(f' {len(b)} |', end='')
print('')
print_table(ErrorCorrectionLevel.M)
print()
print_table(ErrorCorrectionLevel.H)
27 | 43 | 59 | 77 | 99 | 139 | |
---|---|---|---|---|---|---|
R7 | - | 1 | 1 | 1 | 1 | 1 |
R9 | - | 1 | 1 | 1 | 1 | 2 |
R11 | 1 | 1 | 1 | 1 | 2 | 1 |
R13 | 1 | 1 | 1 | 2 | 2 | 2 |
R15 | - | 1 | 1 | 2 | 1 | 2 |
R17 | - | 1 | 1 | 1 | 2 | 1 |
27 | 43 | 59 | 77 | 99 | 139 | |
---|---|---|---|---|---|---|
R7 | - | 1 | 1 | 1 | 1 | 1 |
R9 | - | 1 | 1 | 2 | 1 | 1 |
R11 | 1 | 1 | 2 | 2 | 2 | 1 |
R13 | 1 | 1 | 1 | 2 | 2 | 2 |
R15 | - | 2 | 1 | 2 | 1 | 2 |
R17 | - | 2 | 1 | 2 | 1 | 2 |
line 394,406 : Change break
into continue
(I'll make a PR after I check some cases.)
The codes that generated this library with these versions are could not be recognized with QRQR.
to Reproduce
Scan the code generated by the following code:
Versions that could not be recognized
ErrorCorrectionLevel.M
ErrorCorrectionLevel.H