Issue 495: Renamed DATAMATRIX to DATA_MATRIX for consistency.
[zxing.git] / zxingorg / src / com / google / zxing / web / DecodeServlet.java
index e3245c1..6a64c3e 100644 (file)
@@ -101,17 +101,19 @@ public final class DecodeServlet extends HttpServlet {
   static {
     HINTS = new Hashtable<DecodeHintType, Object>(5);
     HINTS.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
-    Collection<BarcodeFormat> possibleFormats = new Vector<BarcodeFormat>();
+    Collection<BarcodeFormat> possibleFormats = new Vector<BarcodeFormat>(17);
     possibleFormats.add(BarcodeFormat.UPC_A);
     possibleFormats.add(BarcodeFormat.UPC_E);
     possibleFormats.add(BarcodeFormat.EAN_8);
     possibleFormats.add(BarcodeFormat.EAN_13);
     possibleFormats.add(BarcodeFormat.CODE_39);
+    possibleFormats.add(BarcodeFormat.CODE_93);
     possibleFormats.add(BarcodeFormat.CODE_128);
+    //possibleFormats.add(BarcodeFormat.CODABAR);
     possibleFormats.add(BarcodeFormat.ITF);
-    possibleFormats.add(BarcodeFormat.RSS14);    
+    possibleFormats.add(BarcodeFormat.RSS14);
     possibleFormats.add(BarcodeFormat.QR_CODE);
-    possibleFormats.add(BarcodeFormat.DATAMATRIX);
+    possibleFormats.add(BarcodeFormat.DATA_MATRIX);
     possibleFormats.add(BarcodeFormat.PDF417);
     HINTS.put(DecodeHintType.POSSIBLE_FORMATS, possibleFormats);
     HINTS_PURE = new Hashtable<DecodeHintType, Object>(HINTS);
@@ -282,10 +284,13 @@ public final class DecodeServlet extends HttpServlet {
       response.sendRedirect("badimage.jspx");
       return;
     }
-    if (image == null ||
-        image.getHeight() <= 1 || image.getWidth() <= 1 ||
+    if (image == null) {
+      response.sendRedirect("badimage.jspx");
+      return;
+    }
+    if (image.getHeight() <= 1 || image.getWidth() <= 1 ||
         image.getHeight() * image.getWidth() > MAX_PIXELS) {
-      log.fine("Dimensions too large: " + image.getWidth() + 'x' + image.getHeight());        
+      log.fine("Dimensions too large: " + image.getWidth() + 'x' + image.getHeight());
       response.sendRedirect("badimage.jspx");
       return;
     }