IMCtermite icon indicating copy to clipboard operation
IMCtermite copied to clipboard

fix: make digital dtype11 decode spec-compliant and deterministic

Open jgoedeke opened this issue 9 months ago • 0 comments

I found an issue with datatype 11 parsing in scaled mode, where unset CR/CD fields lead to jibberish calculations and random float values. This PR is based on #39

  • Prevent uninitialized CR/CD metadata from leaking into decode paths by adding safe defaults and explicit presence handling
  • Apply CR scaling only where valid; keep datatype 11 (2-byte digital) on identity transform in scaled mode
  • Enforce clear fail-fast behavior when required CD timing metadata is missing for single-component channels
  • Add regression tests:
    • datatype 11 scaled output matches raw values
    • non-digital channels still satisfy scaled = raw * factor + offset

jgoedeke avatar Feb 25 '26 07:02 jgoedeke