mirror of
https://github.com/zxing/zxing.git
synced 2024-09-19 21:17:33 -07:00
ZXing 3.3.2 snapshot still creates wrong barcode for text with leadin… (#967)
* ZXing 3.3.2 snapshot still creates wrong barcode for text with leading asterisk #960 * missing spaces
This commit is contained in:
parent
c3d649f6ab
commit
a3bbebccba
|
@ -66,6 +66,11 @@ final class EdifactEncoder implements Encoder {
|
||||||
context.updateSymbolInfo();
|
context.updateSymbolInfo();
|
||||||
int available = context.getSymbolInfo().getDataCapacity() - context.getCodewordCount();
|
int available = context.getSymbolInfo().getDataCapacity() - context.getCodewordCount();
|
||||||
int remaining = context.getRemainingCharacters();
|
int remaining = context.getRemainingCharacters();
|
||||||
|
// The following two lines are a hack inspired by the 'fix' from https://sourceforge.net/p/barcode4j/svn/221/
|
||||||
|
if (remaining > available) {
|
||||||
|
context.updateSymbolInfo(context.getCodewordCount() + 1);
|
||||||
|
available = context.getSymbolInfo().getDataCapacity() - context.getCodewordCount();
|
||||||
|
}
|
||||||
if (remaining <= available && available <= 2) {
|
if (remaining <= available && available <= 2) {
|
||||||
return; //No unlatch
|
return; //No unlatch
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue