Closed emehmet closed 11 years ago
That's simple: the last character is not an information, it's a checksum
Thanks for your reply.
But at our barcode systems need to last character.
such as barcode image at Follow links:
http://tobeytailor.s3.amazonaws.com/get_barcode_from_image/index.html
Exact Image's bardecode does not provide it, but you can easily calculate that character: https://en.wikipedia.org/wiki/EAN-13
Thank you. I solved this problem.
No problem. You can share your code here if you like ;)
function calculateBarcodeWithChecksum(barcode) {
var no = barcode;
var sequence_ean13= [1,3];
var sums = 0;
var no_array = no.split("");
for (var i = 0; i < no_array.length; i++) {
sums += no_array[i] * sequence_ean13[i % 2];
}
var checksum = 10 - (sums % 10);
if(checksum == 10){
checksum = 0;
}
var ean_code = no+checksum;
return ean_code;
}
Hi,
i have 13 cahacter barcode image. i reading this barcode image but last character is lost.????
and even the case in your demo page.