Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

Fixed alignemnt pattern position array order#5

Open
Michael Hollister (Michael-Hollister) wants to merge 1 commit into
paramount-engineering:mainfrom
Michael-Hollister:michael/qr-code-alignment-fix
Open

Fixed alignemnt pattern position array order#5
Michael Hollister (Michael-Hollister) wants to merge 1 commit into
paramount-engineering:mainfrom
Michael-Hollister:michael/qr-code-alignment-fix

Conversation

@Michael-Hollister

Copy link
Copy Markdown

Wanted to share a fix for QR code generation in case you are open to contributions:

Fixing an issue where the QR alignment pattern position array is not created in ascending order. When the array is out-of-order, this breaks the array ordering assumption in qrCode.draw.brs:_qrCode_draw_drawFunctionPatterns that prevents alignment patterns being generated over finder patterns. This results in the drawn QR code being invalid (for large encoded text size) and not scannable with a QR code scanner.

qrCode.draw.brs:_qrCode_draw_drawFunctionPatterns:

  ' Don't draw on the three finder corners
  if (not ((i = 0) and (j = 0) or (i = 0) and (j = numAlign - 1) or (i = numAlign - 1) and (j = 0))) then
      m.drawAlignmentPattern(alignPatPos[i], alignPatPos[j])
  end if

Additionally removed the splice function since it was not used anywhere else in the code.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant