[barcode] [Fwd: improvements/bugfixes upon barcode-0.96]

Boszormenyi Zoltan zboszor@externet.hu
Thu, 09 Aug 2001 09:38:57 +0200


This is a multi-part message in MIME format.
--------------F3C3F69C1044968C94E6CB7F
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 7bit

I sent this to rubini@gnu.org first, but I got no reply.
Alessandro may be on holiday.

Boszormenyi Zoltan wrote:

> Hi!
>
> Here is a big patch that improves upon barcode-0.96.
>
> The improvements/bugfixes are:
>
> - I found that barcode-0.96 does not correctly encodes UPC-E.
>   This was mainly because in upc_e_to_a() the switch() branches
>   all ended without "break;".
>
> - Printing UPC-E did not print the leading encoding number and
>   the trailing UPC-A checksum. Now it does.
>
> - Accept EAN-13 and EAN-8 with and without the checksum.
>   So always treat 7 and 12 digit sequences as valid EAN codes
>   and accept 8 and 13 digit sequences as valid EAN codes when
>   the last digit is the same as the calculated one.
>
> - Accept UPC-A as above (11 or 12 digit sequences.)
>
> - Accepts UPC-E as:
>   6 digit sequence: the middle part of the barcode. A leading '0' assumed.
>   7 digit sequence: the middle part and either a leading '0' or '1',
>     or a trailing UPC-A checksum. In the latter case, a leading '0'
> assumed.
>   8 digit sequence: a leading '0' or '1', the middle part and the trailing
> UPC-A checksum.

 - And since a 7 or 12 digit sequence is ambiguous, UPC is checked before EAN
if
    you specify BARCODE_ANY.

To clarify: the above four are because my scanner's default is that it
transfers
the checksum and an ENTER after the barcode. I find it convenient to be able
to type:

barcode -E -b "" -o something.eps

and go between the quotes and read the barcode with my scanner. It is
connected
to the keyboard. :-) So I can automatically reprint the barcode in the
correct standard.

>
> - According to http://www.barcodeisland.com/upce.phtml ,
>
>   " ... UPC-E may only be used if the number system is 0 or 1."
>
>   For number system (or encoding) 1, the parity table is inverted,
>   e.g. when the UPC-A checksum is 0, the parity is "---111" as in
>   upc_mirrortab[0] (in ean.c) for encoding '0'. For encoding '1',
>   this would be "111---", and so on. For compliance, I implemented this.
>
>   Unfortunately, my scanner cannot read these kinds of barcodes.
>   Please, look at it, I may have made it wrong.
>
> - According to http://www.barcodeisland.com/upcext.phtml ,
>
>     "  UPC-A, UPC-E, EAN-13, and EAN-8 may all include
>        an additional barcode to the right of the main barcode.  "
>
>   So accept and print the 2 or 5-digit add-ons in every case.
>   My scanner reads all following barcodes correctly:
>      04252614 12          UPC-E
>      04252614 12345       UPC-E
>      12345670 12          EAN-8
>      12345670 12345       EAN-8
>      012345678905 12      UPC-A
>      012345678905 12345   UPC-A
>      0123456789012 12     EAN-13
>      0123456789012 12345  EAN-13
>   These were printed on a Canon BJC-250, a middle-to-low quality
>   bubble-jet printer. Although the barcodes all have visible
>   stairs, the scanner was able to read them without problems.
>
> - If you print as Encapsulated Postscript, do not write "showpage\n"
>   because this way a Postscript file can "run" (or include / embed) it
> without
>   problems. GhostScript / GV gave me errors because of this.
>
> Regards,
> Zoltan Boszormenyi <zboszor@mail.externet.hu>

--------------F3C3F69C1044968C94E6CB7F
Content-Type: application/x-gzip;
 name="barcode-0.96.diff3.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="barcode-0.96.diff3.gz"

H4sICH4RcTsAA2JhcmNvZGUtMC45Ni5kaWZmMwDtPNty28aSz9RXjFnlSDQAiQNeRUXeKInO
Od5NlFTs7D44KhVEgiLWJMADgFZUPv737cvMYAACJGWn9mWXDxKJmenu6el7A5hF87nwNumN
uA/SaTILve7p+fA0SaOHM/wp/fHptDRWXD7yPG/Xsta7TShuko9CjIQcTwb+RA6E3+12jxzH
aYDZerfYiKt1KvyhkP2JlJMBrZFH330nvJHvjoRDf7/77kiIVwIXCljp3Ysoni43szATwXIp
1mkU58H9MhRBNo0iMV0EaYYrzo7EkQdj4nvGfweL7+8+hmk0fzrBWeJVHv6Zd46cpkmbOIse
4nAm7NniEwCHTzQXJy+yPF2G8QmNwFArDfNNGgtPXhzNdvA7DOIqr+lSA59prPVfQMi/BzHy
q+tP/O6k22vgcTH/avMgxFgAc/3eZDAq+Dscu0PhwF84KGIwftqAXkr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