Repository navigation
pdf417: fix left row indicator for rows using cluster 0 symbol characters - #102
Merged
Merged
Conversation
This correction is souced from the USS PDF417 specification: > The symbol character value of the left row indicator (L_i) is given > by: > > L_i = 30 * x_i + y if c_i = 0 > L_i = 30 * x_i + z if c_i = 3 > L_i = 30 * x_i + v if c_i = 6 > > Where: > > x_i = (row number -1) div 3 for i = 1 to 90 > y = (number of rows - 1) div 3 > z = (error correction level) * 3 + (number of rows - 1) mod 3 > v = number of columns in the data region - 1 > c_i = cluster number of the i th row > > div is the integer division operator, rounding down > mod is the remainder after division. A regression test has been included with hand-computed values to ensure that we get the expected results. The major impact of this change to downstream consumers is that any golden tests against the output of this package will need to be updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #93 so that rows using cluster 0 symbol characters are correctly calculated.
A regression test has been included with hand-computed values to ensure that we get the expected results across a range of inputs.
The major impact of this change to downstream consumers is that any golden tests against the output of this package will need to be updated.
Specification
The correction is sourced from the USS PDF417 specification:
Left row indicator:
Right row indicator:
Where:
divis the integer division operator, rounding down;modis the remainder after division.