- String resultText = result.getText();
-
- // make sure we terminate inner loop after this because we found something
- attempt = 1;
- // See if we should skip and keep looking
- if (( isAbove && resultText.equals(lastResultAboveText)) ||
- (!isAbove && resultText.equals(lastResultBelowText))) {
- // Just saw the last barcode again, proceed
- continue;
- }
-
- if (skippingSomeBarcodes) {
- int oldValue = ((Integer) hints.get(DecodeHintType.SKIP_N_BARCODES)).intValue();
- if (oldValue > 1) {
- hints.put(DecodeHintType.SKIP_N_BARCODES, new Integer(oldValue - 1));
- } else {
- hints.remove(DecodeHintType.SKIP_N_BARCODES);
- skippingSomeBarcodes = false;
- }
- if (isAbove) {
- lastResultAboveText = resultText;
- } else {
- lastResultBelowText = resultText;
- }
- } else {
- // We found our barcode
- if (attempt == 1) {
- // But it was upside down, so note that
- result.putMetadata(ResultMetadataType.ORIENTATION, new Integer(180));
- }
- return result;
+ // We found our barcode
+ if (attempt == 1) {
+ // But it was upside down, so note that
+ result.putMetadata(ResultMetadataType.ORIENTATION, new Integer(180));