mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Merge pull request #70 from chriskeyring/master
Code 39 Barcodes Generated Backwards
This commit is contained in:
commit
a5e1f2b197
|
@ -68,7 +68,7 @@ public final class Code39Writer extends OneDimensionalCodeWriter {
|
|||
int[] narrowWhite = {1};
|
||||
pos += appendPattern(result, pos, narrowWhite, false);
|
||||
//append next character to bytematrix
|
||||
for(int i = length-1; i >= 0; i--) {
|
||||
for (int i = 0; i < length; i++) {
|
||||
int indexInString = Code39Reader.ALPHABET_STRING.indexOf(contents.charAt(i));
|
||||
toIntArray(Code39Reader.CHARACTER_ENCODINGS[indexInString], widths);
|
||||
pos += appendPattern(result, pos, widths, true);
|
||||
|
@ -81,7 +81,7 @@ public final class Code39Writer extends OneDimensionalCodeWriter {
|
|||
|
||||
private static void toIntArray(int a, int[] toReturn) {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
int temp = a & (1 << i);
|
||||
int temp = a & (1 << (8 - i));
|
||||
toReturn[i] = temp == 0 ? 1 : 2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue