Fixing checksum error in UPC-E barcodes (#1130)

* Converting to UPC-A before checking for matching check digits
This commit is contained in:
fitchfuloffun 2019-02-05 01:54:41 +11:00 committed by Sean Owen
parent 5e8c3d490f
commit eb6bea6ed3

View file

@ -64,7 +64,7 @@ public final class UPCEWriter extends UPCEANWriter {
break;
case 8:
try {
if (!UPCEANReader.checkStandardUPCEANChecksum(contents)) {
if (!UPCEANReader.checkStandardUPCEANChecksum(UPCEReader.convertUPCEtoUPCA(contents))) {
throw new IllegalArgumentException("Contents do not pass checksum");
}
} catch (FormatException ignored) {