Skip to content

Two wrong entries in rmqr_versions and a dropped codeword in _make_final_codewords #63

Description

@toolicious

I used this library as a reference while writing an rMQR encoder in Kotlin and cross-checked its tables against Zint (backend/qr.h). Three things came up.

  1. R13x27, level M has k=14 in rmqr_versions.py, but number_of_data_bits for the same version and level is 96, which is 12 codewords. Zint also says 12.

  2. R17x43, level M has c=60, while codewords_total for that version is 61. Zint also says 61.

  3. _make_final_codewords breaks out of the block loop when a block has no codeword at the current index, instead of skipping that block. The short blocks come first, so once the first one runs out, the longer blocks never contribute their last data codeword. This affects the eight level M versions whose blocks differ in length:

q = rMQR('R13x139', ErrorCorrectionLevel.M)
q.add_segment('A' * 60)
q.make()
# len(final_codewords) is 165, codewords_total is 166

Using continue instead of break fixes it.

One more data point for 1 and 2: the block layout can be derived from total codewords, data codewords and block count, with the same number of EC codewords per block and the extra data codeword going to the last blocks. That reproduces your table for 62 of the 64 version and level combinations, and the two that do not match are exactly the entries above.

Happy to send a PR if that helps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions