mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Further adjustment for odd-length Mode C blocks
This commit is contained in:
parent
5b05d8542c
commit
5ddf28ffbb
@ -675,24 +675,21 @@ int ean_128(struct zint_symbol *symbol, unsigned char source[])
|
|||||||
for(i = 0; i < read; i++) {
|
for(i = 0; i < read; i++) {
|
||||||
if(set[i] == 'C') {
|
if(set[i] == 'C') {
|
||||||
if(reduced[i] == '[') {
|
if(reduced[i] == '[') {
|
||||||
if(c_count % 2) {
|
if(c_count % 2) { set[i - c_count] = 'B'; }
|
||||||
set[i - c_count] = 'B';
|
c_count = 0;
|
||||||
c_count = 0;
|
|
||||||
} else {
|
|
||||||
c_count += 2;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
c_count++;
|
c_count++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(c_count % 2)
|
if(c_count % 2) { set[i - c_count] = 'B'; }
|
||||||
set[i - c_count] = 'B';
|
|
||||||
c_count = 0;
|
c_count = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(c_count % 2) {
|
if(c_count % 2) { set[i - c_count] = 'B'; }
|
||||||
set[i - c_count] = 'B';
|
|
||||||
}
|
/* for(i = 0; i < read; i++) {
|
||||||
|
printf("char %c mode %c\n", reduced[i], set[i]);
|
||||||
|
} */
|
||||||
|
|
||||||
/* Now we can calculate how long the barcode is going to be - and stop it from
|
/* Now we can calculate how long the barcode is going to be - and stop it from
|
||||||
being too long */
|
being too long */
|
||||||
|
Loading…
Reference in New Issue
Block a user