Fixed some code which was ignoring the result of MonochromeBitmapSource calls, which...
[zxing.git] / javase / src / com / google / zxing / client / j2se / CommandLineRunner.java
index ea09f34..fba1e9b 100644 (file)
@@ -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;
+
 /**
  * <p>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)) {