<fileset dir="web">
<include name="*.jspx"/>
<include name="*.png"/>
+ <include name="*.css"/>
<include name="**/*.jad"/>
<include name="**/*.jar"/>
</fileset>
import java.net.URI;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
+import java.util.Collection;
import java.util.Hashtable;
import java.util.List;
import java.util.Vector;
static {
HINTS = new Hashtable<DecodeHintType, Object>(5);
HINTS.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
- Vector<BarcodeFormat> possibleFormats = new Vector<BarcodeFormat>();
+ Collection<BarcodeFormat> possibleFormats = new Vector<BarcodeFormat>();
possibleFormats.add(BarcodeFormat.UPC_A);
possibleFormats.add(BarcodeFormat.UPC_E);
possibleFormats.add(BarcodeFormat.EAN_8);
BinaryBitmap bitmap = new BinaryBitmap(new GlobalHistogramBinarizer(source));
result = reader.decode(bitmap, HINTS);
} catch (ReaderException re) {
- log.info("DECODE FAILED: " + re.toString());
- response.sendRedirect("notfound.jspx");
- return;
+ try {
+ // Try again with other binarizer
+ LuminanceSource source = new BufferedImageLuminanceSource(image);
+ BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
+ result = reader.decode(bitmap, HINTS);
+ } catch (ReaderException re2) {
+ log.info("DECODE FAILED: " + re.toString());
+ response.sendRedirect("notfound.jspx");
+ return;
+ }
}
if (request.getParameter("full") == null) {
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Bad Image</title>
+ <link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
- <h1><img src="zxing-icon.png" height="32" width="32" alt=""/> Bad Image</h1>
+ <div id="header"><h1><img src="zxing-icon.png" height="32" width="32" alt=""/> Bad Image</h1></div>
<p>The image you uploaded could not be decoded, or was too large. Go "Back" in your browser and try another
image.
</p>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Bad URL</title>
+ <link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
- <h1><img src="zxing-icon.png" height="32" width="32" alt=""/> Bad URL</h1>
+ <div id="header"><h1><img src="zxing-icon.png" height="32" width="32" alt=""/> Bad URL</h1></div>
<p>You didn't specify a URL, or the URL was not valid, or did not return an image. Go "Back" in your browser and
try again.
</p>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>ZXing Decoder Online</title>
+ <link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
- <h1><img src="zxing-icon.png" height="32" width="32" alt=""/> ZXing Decoder Online</h1>
+ <div id="header"><h1><img src="zxing-icon.png" height="32" width="32" alt=""/> ZXing Decoder Online</h1></div>
<p>This is a simple page that will let you decode a 1D or 2D barcode found
in an image online. Enter a URL below.
</p>
<a href="http://code.google.com/p/zxing">project page</a>
for details.
</p>
- <p>Copyright 2008 and onwards ZXing authors</p>
+ <div id="footer"><p>Copyright 2008 and onwards ZXing authors</p></div>
<jsp:include page="analytics.jspx"/>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Decode Succeeded</title>
+ <link rel="stylesheet" href="style.css" type="text/css"/>
<style type="text/css">
td { vertical-align: top; padding: 0.1in; background-color: #EEEEEE; font-family: monospace; }
</style>
</head>
<body>
- <h1><img src="zxing-icon.png" height="32" width="32" alt=""/> Decode Succeeded</h1>
+ <div id="header"><h1><img src="zxing-icon.png" height="32" width="32" alt=""/> Decode Succeeded</h1></div>
<table>
<tr>
<td>Raw text</td>
<td><jsp:expression>request.getAttribute("displayResult")</jsp:expression></td>
</tr>
</table>
- <p>Copyright 2008 and onwards ZXing authors</p>
+ <div id="footer"><p>Copyright 2008 and onwards ZXing authors</p></div>
<jsp:include page="analytics.jspx"/>
</body>
</html>
<body>
<h1><img src="zxing-icon.png" height="32" width="32" alt=""/> Download ZXing Reader</h1>
<p>
- <a href="BarcodeReader.jad">Download</a> the ZXing Barcode Reader for J2ME.
+ <a href="market://search?q=pname%3Acom.google.zxing.client.android">Download</a> the Android client.
</p>
<p>
- (<a href="basic/BarcodeReader.jad">Download</a> the alternate "basic" version for J2ME.)
+ <a href="BarcodeReader.jad">Download</a> the Barcode Reader for J2ME.
</p>
<p>
- <a href="market://search?q=pname%3Acom.google.zxing.client.android">Download</a> the Android client.
- </p>
+ (<a href="basic/BarcodeReader.jad">Download</a> the alternate "basic" version for J2ME.)
+ </p>
<p>Copyright 2008 and onwards ZXing authors</p>
<jsp:include page="analytics.jspx"/>
</body>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>No Barcode Found</title>
+ <link rel="stylesheet" href="style.css" type="text/css"/>
</head>
<body>
- <h1><img src="zxing-icon.png" height="32" width="32" alt=""/> No Barcode Found</h1>
+ <div id="header"><h1><img src="zxing-icon.png" height="32" width="32" alt=""/> No Barcode Found</h1></div>
<p>No barcode was found in this image. Either it did not contain a barcode, or did not contain one in a
supported format, or the software was simply unable to find it. Go "Back" in your browser and try another image.
</p>
--- /dev/null
+body{background-color:#e9eef3;font-family:Arial,sans-serif;font-size:12px}
+td{font-size:14px}
+#header{background-color:#dde3e9;border-bottom:1px solid #f2f7fc}
+#header h1{font-size:15px;font-weight:bold;padding:12px;border-bottom:1px solid #c8d0d9}
+#header span{font-weight:normal;color:#5e6b75}
+#footer{width:100%;text-align:center;padding-top:12px}
+#footer a{text-decoration:none;color:#5e6b75}