Appear a random number at last char in the barcode encoded image.

I've noticed the problem with ean-13, in the function barcode_ean_check_digit in ean.inc
Seems that even the code is filled up with zeros in front correctly, the $csum_total variable is wrong and the function return the barcode + the checksum digit.

When submitting a code smaller than 13 chars, it must be filled out by '0' char and when doing this, it only fill a message of 12 chars instead 13.
This behavior cause checksum value of the message to be wrong and also the code encoded to image.

Please review and commit

On the file barcode/plugins/ean.inc change this:

    $barnumber = str_pad($barnumber, 12, "0", STR_PAD_LEFT);

with this:

    $barnumber = str_pad($barnumber, 13, "0", STR_PAD_LEFT);

Comments

aCCa’s picture

I'm completely wrong. Check digit MUST be in the EAN code.

aCCa’s picture

Status: Needs review » Closed (works as designed)

Close issue.

Dean AAron’s picture

Hey, try this powerful barcode generation (including EAN-13) component (for .NET & Java), it can automatically add checksum digit to the barcode and you also able to customize the barcode setting, comply with ISO specification. Hope it is help you solve your problem.
http://www.onbarcode.com/products/net_barcode/
http://www.onbarcode.com/products/java_barcode/

makaveiljojo’s picture

The check gigit of EAN 13 is an essential factor when the accuracy of the encoded data is verified. EAN-13 is self-checking with one mandatory check digit that can be calculated from 12 encodable characters.
To generate EAN 13 barcode easily, you may search for some EAN-13 font or EAN-13 .NET control.
Good luck!

Ktueethall’s picture

Issue summary: View changes

" The check gigit of EAN 13 is an essential factor when the accuracy of the encoded data is verified. EAN-13 is self-checking with one mandatory check digit that can be calculated from 12 encodable characters.
To generate EAN 13 barcode easily, you may search for some EAN-13 font or EAN-13 .NET control.
Good luck!"
Thanks for such great information for barcode creating.