From da4f56b0223c13382d9b53566f77715500bcc933 Mon Sep 17 00:00:00 2001 From: dswitkin Date: Thu, 25 Jun 2009 19:46:49 +0000 Subject: [PATCH] Fixed some code which was ignoring the result of MonochromeBitmapSource calls, which may work in some cases but isn't legal and failed and in some experiments. git-svn-id: https://zxing.googlecode.com/svn/trunk@986 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- core/src/com/google/zxing/oned/AbstractOneDReader.java | 2 +- .../zxing/qrcode/detector/AlignmentPatternFinder.java | 2 +- .../com/google/zxing/client/j2se/CommandLineRunner.java | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/src/com/google/zxing/oned/AbstractOneDReader.java b/core/src/com/google/zxing/oned/AbstractOneDReader.java index 8eb26e05d..508e05c2c 100644 --- a/core/src/com/google/zxing/oned/AbstractOneDReader.java +++ b/core/src/com/google/zxing/oned/AbstractOneDReader.java @@ -112,7 +112,7 @@ public abstract class AbstractOneDReader implements OneDReader { } catch (ReaderException re) { continue; } - image.getBlackRow(rowNumber, row, 0, width); + row = image.getBlackRow(rowNumber, row, 0, width); // While we have the image data in a BitArray, it's fairly cheap to reverse it in place to // handle decoding upside down barcodes. diff --git a/core/src/com/google/zxing/qrcode/detector/AlignmentPatternFinder.java b/core/src/com/google/zxing/qrcode/detector/AlignmentPatternFinder.java index 25e312b20..01066e3ef 100644 --- a/core/src/com/google/zxing/qrcode/detector/AlignmentPatternFinder.java +++ b/core/src/com/google/zxing/qrcode/detector/AlignmentPatternFinder.java @@ -92,7 +92,7 @@ final class AlignmentPatternFinder { for (int iGen = 0; iGen < height; iGen++) { // Search from middle outwards int i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1)); - image.getBlackRow(i, luminanceRow, startX, width); + luminanceRow = image.getBlackRow(i, luminanceRow, startX, width); stateCount[0] = 0; stateCount[1] = 0; stateCount[2] = 0; diff --git a/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java b/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java index ea09f34cf..fba1e9b87 100644 --- a/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java +++ b/javase/src/com/google/zxing/client/j2se/CommandLineRunner.java @@ -26,7 +26,6 @@ import com.google.zxing.client.result.ParsedResult; import com.google.zxing.client.result.ResultParser; import com.google.zxing.common.BitArray; -import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileNotFoundException; @@ -40,6 +39,8 @@ import java.net.URISyntaxException; import java.nio.charset.Charset; import java.util.Hashtable; +import javax.imageio.ImageIO; + /** *

This simple command line utility decodes files, directories of files, or URIs which are passed * as arguments. By default it uses the normal decoding algorithms, but you can pass --try_harder to @@ -215,7 +216,7 @@ public final class CommandLineRunner { } continue; } - source.getBlackRow(y, row, 0, width); + row = source.getBlackRow(y, row, 0, width); int offset = y * stride + width; for (int x = 0; x < width; x++) { if (row.get(x)) { @@ -230,7 +231,7 @@ public final class CommandLineRunner { try { source.estimateBlackPoint(BlackPointEstimationMethod.TWO_D_SAMPLING, 0); for (int y = 0; y < height; y++) { - source.getBlackRow(y, row, 0, width); + row = source.getBlackRow(y, row, 0, width); int offset = y * stride + width * 2; for (int x = 0; x < width; x++) { if (row.get(x)) {