Skip to content

fix: return exact scanned MRZ + full Guatemala document number#11

Draft
haklyray wants to merge 1 commit into
masterfrom
fix/mrz-raw-scan-and-gtm-docnum
Draft

fix: return exact scanned MRZ + full Guatemala document number#11
haklyray wants to merge 1 commit into
masterfrom
fix/mrz-raw-scan-and-gtm-docnum

Conversation

@haklyray

Copy link
Copy Markdown

What

  • MrzRecord.rawMrz — records now keep the exact parsed (cleaned) MRZ string. Callers can return the scanned value verbatim instead of the lossy toMrz() reconstruction, which rebuilds line 1 with a fixed 9-char document-number field and truncates overflow numbers (e.g. the 11-digit Dominican cédula). toMrz() is left intact but documented as lossy.
  • Guatemala documentNumber (9 → 13)Guatemala_ID now appends the 4 extra document-number digits carried in the optional field (new DPI format) for the full 13-digit number, falling back to the 9-digit field when those 4 chars are not digits (older cards).
  • Build modernizationparser/build.gradle updated (namespace, compileSdk 34, Java 21) so the parser builds from source under a current AGP, and can be consumed as a source submodule by smartscanner-core.

Tests

MrzParserFixTest: rawMrz round-trip, DOM 11-digit document number preserved, GTM new-format → 13 digits, GTM old-format → 9 digits. Verified via :smartscanner-mrz-parser:testDebugUnitTest (built through smartscanner-core's AGP 9 / Gradle 9.1 toolchain).

Notes

  • Standalone build of this repo still uses the stale root build.gradle (Gradle 6.5 / jcenter); modernizing the root + wrapper is a follow-up. No CI is configured here today.

Records now keep the exact parsed (cleaned) MRZ in MrzRecord.rawMrz, so callers can
return the scanned value verbatim instead of the lossy toMrz() reconstruction — which
rebuilds line 1 with a fixed 9-char document-number field and truncates overflow numbers
such as the 11-digit Dominican cédula.

Guatemala_ID now appends the 4 extra document-number digits carried in the optional field
(new DPI format) to produce the full 13-digit number, falling back to the 9-digit field
when those 4 chars are not digits (older cards).

Modernize the parser module build (namespace, compileSdk 34, Java 21) so it builds from
source under a current AGP; add MrzParserFixTest covering rawMrz and the GTM 9/13 rule.
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