Skip to content

Commit

Permalink
Ported from ZXing: "Remove deviation from PDF417 spec and faulty unit
Browse files Browse the repository at this point in the history
test (thanks Anders)"
  • Loading branch information
cwalcott committed Oct 22, 2012
1 parent d26bc81 commit ef8ef5c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 12 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Aitor Almeida (University of Deusto)
Alasdair Mackintosh (Google)
Alex Dupre
Alexander Martin (Haase & Martin GmbH)
Anders Borg
Andreas Pillath
Andrew Walbran (Google)
Andrey Sitnik
Expand Down
8 changes: 0 additions & 8 deletions ZXingObjC/pdf417/decoder/ZXPDF417DecodedBitStreamParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ + (void)decodeTextCompaction:(int*)textCompactionData byteCompactionData:(int*)b
subMode = PUNCT_SHIFT;
} else if (subModeCh == MODE_SHIFT_TO_BYTE_COMPACTION_MODE) {
[result appendFormat:@"%C", (unichar)byteCompactionData[i]];
// the pdf417 specs say we have to return to the last latched
// sub-mode. But I checked different encoder implementations and
// all of them return to alpha sub-mode after Shift-to-Byte
subMode = ALPHA;
} else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) {
subMode = ALPHA;
}
Expand Down Expand Up @@ -330,10 +326,6 @@ + (void)decodeTextCompaction:(int*)textCompactionData byteCompactionData:(int*)b
// PS before Shift-to-Byte is used as a padding character,
// see 5.4.2.4 of the specification
[result appendFormat:@"%C", (unichar)byteCompactionData[i]];
// the pdf417 specs say we have to return to the last latched
// sub-mode. But I checked different encoder implementations and
// all of them return to alpha sub-mode after Shift-to-Byte
subMode = ALPHA;
} else if (subModeCh == TEXT_COMPACTION_MODE_LATCH) {
subMode = ALPHA;
}
Expand Down
Binary file removed ZXingObjCTests/Resources/blackbox/pdf417/08.gif
Binary file not shown.
1 change: 0 additions & 1 deletion ZXingObjCTests/Resources/blackbox/pdf417/08.txt

This file was deleted.

2 changes: 1 addition & 1 deletion ZXingObjCTests/datamatrix/DataMatrixBlackBox2TestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ - (id)initWithInvocation:(NSInvocation *)anInvocation {
[self addTest:8 tryHarderCount:8 maxMisreads:0 maxTryHarderMisreads:1 rotation:0.0f];
[self addTest:14 tryHarderCount:14 maxMisreads:0 maxTryHarderMisreads:1 rotation:90.0f];
[self addTest:14 tryHarderCount:14 maxMisreads:0 maxTryHarderMisreads:1 rotation:180.0f];
[self addTest:12 tryHarderCount:12 maxMisreads:0 maxTryHarderMisreads:1 rotation:270.0f];
[self addTest:13 tryHarderCount:13 maxMisreads:0 maxTryHarderMisreads:1 rotation:270.0f];
}

return self;
Expand Down
4 changes: 2 additions & 2 deletions ZXingObjCTests/pdf417/PDF417BlackBox1TestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ - (id)initWithInvocation:(NSInvocation *)anInvocation {
expectedFormat:kBarcodeFormatPDF417];

if (self) {
[self addTest:5 tryHarderCount:5 rotation:0.0f];
[self addTest:5 tryHarderCount:5 rotation:180.0f];
[self addTest:4 tryHarderCount:4 rotation:0.0f];
[self addTest:4 tryHarderCount:4 rotation:180.0f];
}

return self;
Expand Down

0 comments on commit ef8ef5c

Please sign in to comment.