mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Try both binarizers, use appspot stylesheet, update dependency libs
git-svn-id: https://zxing.googlecode.com/svn/trunk@1192 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
171bd88c5d
commit
7cd9541e90
|
@ -84,6 +84,7 @@
|
|||
<fileset dir="web">
|
||||
<include name="*.jspx"/>
|
||||
<include name="*.png"/>
|
||||
<include name="*.css"/>
|
||||
<include name="**/*.jad"/>
|
||||
<include name="**/*.jar"/>
|
||||
</fileset>
|
||||
|
|
|
@ -63,6 +63,7 @@ import java.net.SocketException;
|
|||
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;
|
||||
|
@ -93,7 +94,7 @@ public final class DecodeServlet extends HttpServlet {
|
|||
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);
|
||||
|
@ -253,9 +254,16 @@ public final class DecodeServlet extends HttpServlet {
|
|||
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) {
|
||||
|
|
Binary file not shown.
BIN
zxingorg/web/WEB-INF/lib/commons-codec-1.4.jar
Normal file
BIN
zxingorg/web/WEB-INF/lib/commons-codec-1.4.jar
Normal file
Binary file not shown.
BIN
zxingorg/web/WEB-INF/lib/httpclient-4.0.1.jar
Normal file
BIN
zxingorg/web/WEB-INF/lib/httpclient-4.0.1.jar
Normal file
Binary file not shown.
Binary file not shown.
BIN
zxingorg/web/WEB-INF/lib/httpmime-4.0.1.jar
Normal file
BIN
zxingorg/web/WEB-INF/lib/httpmime-4.0.1.jar
Normal file
Binary file not shown.
Binary file not shown.
|
@ -22,9 +22,10 @@
|
|||
<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>
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
<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>
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
<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>
|
||||
|
@ -45,7 +46,7 @@
|
|||
<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>
|
||||
|
|
|
@ -24,12 +24,13 @@
|
|||
<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>
|
||||
|
@ -52,7 +53,7 @@
|
|||
<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>
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
<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="BarcodeReader.jad">Download</a> the Barcode Reader for J2ME.
|
||||
</p>
|
||||
<p>
|
||||
(<a href="basic/BarcodeReader.jad">Download</a> the alternate "basic" version for J2ME.)
|
||||
</p>
|
||||
<p>
|
||||
<a href="market://search?q=pname%3Acom.google.zxing.client.android">Download</a> the Android client.
|
||||
</p>
|
||||
</p>
|
||||
<p>Copyright 2008 and onwards ZXing authors</p>
|
||||
<jsp:include page="analytics.jspx"/>
|
||||
</body>
|
||||
|
|
|
@ -22,9 +22,10 @@
|
|||
<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>
|
||||
|
|
7
zxingorg/web/style.css
Normal file
7
zxingorg/web/style.css
Normal file
|
@ -0,0 +1,7 @@
|
|||
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}
|
Loading…
Reference in a new issue