Skip to content

Implement various format and code fixes. - #26

Merged
ruediger merged 15 commits into
mainfrom
fixes
Aug 2, 2026
Merged

Implement various format and code fixes.#26
ruediger merged 15 commits into
mainfrom
fixes

Conversation

@ruediger

@ruediger ruediger commented Aug 2, 2026

Copy link
Copy Markdown
Owner

No description provided.

ruediger added 15 commits August 2, 2026 00:50
1. Test function patterns survive encoding
2. Test format patterns
3. Test version pattern
Right order is (/ (+ 4 ccbits) 8). This caused over-reservation of
three bytes.

Also improved test to cover more versions.
This was a byte left over from initial development. Kinda slipped
through all these years. It didn't cause a bad decoding but wasted a
byte.
That way qrencode.elc gets rebuild instead of accidentally testing a
stale version.
* Split penalties into separate functions for each rule to simplify
testing
* Fix skipping last col / row (added test)
* Fix dark-light ratio calculation (added test)
* More tests
This didn't impact anything due to symmetry but better not have hidden issues.
Only `byte` mode is supported. But still better to pass it all the way
through.
Using `vector` instead of a literal means the byte compiler will
compile the lambdas. Speeding up execution of the code.
This makes it explicit that the test was skipped.
The standard specifies a step order but actually step 7 and 6 seem to
be out of order.  When calculating penalties and picking the right
mask (step 6) the version/format information (step 7) should be
included.  This is now fixed.
Use cond instead of pcase which means we don't need the
`qrencode--unused` hack.  Also enforce a valid mode is set.
Remove unnecessary save-excursion and move pop-to-buffer out of
with-current-buffer.
The previous version was generated with a very early version of the
code that didn't properly implement penalties.  This version should be
better up to standard.
@ruediger
ruediger merged commit f238db7 into main Aug 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant