Menu

#145 Possible DataBar (RSS) bug (FNC1 handling)

1.0
wont-fix
None
2020-03-29
2019-04-23
No

Expanding the test code coverage for Okapi Barcode recently, I ran across what looks like a pair of bugs in the DataBar Expanded implementation -- and Zint appears to have a similar issue. Specifically, when FNC1 is encountered during ALPHA or ISOIEC encodation, the mode is being changed to NUMERIC. However, I don't think this is necessary or desired -- I think we want to stay in the current encodation mode.

Okapi Barcode commit which fixed the issue here:

https://github.com/woo-j/OkapiBarcode/commit/1618589376f23db7436d6a9de14ffc77ef58f6c5

Two test cases which trigger the bug here:

https://github.com/woo-j/OkapiBarcode/blob/master/src/test/resources/uk/org/okapibarcode/backend/databarexpanded/fnc1-after-alpha.properties

https://github.com/woo-j/OkapiBarcode/blob/master/src/test/resources/uk/org/okapibarcode/backend/databarexpanded/fnc1-after-iso-iec.properties

This was initially detected because we verify that each of our Okapi test barcodes can be decoded by the ZXing library, and ZXing failed to decode these two test samples without this change.

Corresponding lines in the Zint code:

https://sourceforge.net/p/zint/code/ci/master/tree/backend/rss.c#l1666

https://sourceforge.net/p/zint/code/ci/master/tree/backend/rss.c#l1705

Discussion

  • Robin Stuart

    Robin Stuart - 2019-04-24

    Hi Daniel,

    I've had a look at this and I think the code in Zint is right. Here is my reasoning...

    The specification (ISO 24724) refers to the sequence 01111 as "FNC1/Numeric latch" in both table 12 (alphanumeric encodation) and table 13 (ISO/IEC 646 encodation).

    FNC1 in a GS-1 symbol will always be followed by an AI, and AIs are always numeric, so it makes sense to have an implied latch to numeric mode, reducing the length of the general purpose data compaction field by 3 binary digits.

    Tec-It's encoder seems to produce the same symbol as Zint:
    https://barcode.tec-it.com/en/RSSExpanded?data=420TEST%5CF39231234567

    Robin.

     
  • Daniel Gredler

    Daniel Gredler - 2019-05-15

    Hi Robin,

    Thanks for looking at this! Your logic sounds right to me, and it's compelling that other tools generate the same output. I'm going to leave the implicit mode change out in Okapi for now in order to achieve wider compatibility (with e.g. ZXing), but hopefully it can be added back in at some point.

    Daniel

     
  • Harald Oehlmann

    Harald Oehlmann - 2019-08-30
    • status: open --> pending
    • assigned_to: Harald Oehlmann
     
  • Harald Oehlmann

    Harald Oehlmann - 2019-08-30

    Daniel,
    may this ticket be closed ?

    Thank you,
    Harald

     
  • Robin Stuart

    Robin Stuart - 2020-03-29

    I think it is safe to close this ticket now.

     
  • Robin Stuart

    Robin Stuart - 2020-03-29
    • status: pending --> wont-fix
     

Log in to post a comment.

MongoDB Logo MongoDB