Fix small display problem when extension starts with 9
[zxing.git] / core / src / com / google / zxing / oned / OneDReader.java
index 0717c5d..102483c 100644 (file)
@@ -40,7 +40,7 @@ import java.util.Hashtable;
  */
 public abstract class OneDReader implements Reader {
 
-  private static final int INTEGER_MATH_SHIFT = 8;
+  protected static final int INTEGER_MATH_SHIFT = 8;
   protected static final int PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << INTEGER_MATH_SHIFT;
 
   public Result decode(BinaryBitmap image) throws NotFoundException, FormatException {
@@ -103,12 +103,12 @@ public abstract class OneDReader implements Reader {
 
     int middle = height >> 1;
     boolean tryHarder = hints != null && hints.containsKey(DecodeHintType.TRY_HARDER);
-    int rowStep = Math.max(1, height >> (tryHarder ? 8 : 4));
+    int rowStep = Math.max(1, height >> (tryHarder ? 8 : 5));
     int maxLines;
     if (tryHarder) {
       maxLines = height; // Look at the whole image, not just the center
     } else {
-      maxLines = 9; // Nine rows spaced 1/16 apart is roughly the middle half of the image
+      maxLines = 15; // 15 rows spaced 1/32 apart is roughly the middle half of the image
     }
 
     for (int x = 0; x < maxLines; x++) {