Issue 312, use old global binarizer for uploaded images

git-svn-id: https://zxing.googlecode.com/svn/trunk@1176 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2010-01-05 15:33:53 +00:00
parent c7ab6ce807
commit 6b4a10a302

View file

@ -27,6 +27,7 @@ import com.google.zxing.Result;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource; import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.client.result.ParsedResult; import com.google.zxing.client.result.ParsedResult;
import com.google.zxing.client.result.ResultParser; import com.google.zxing.client.result.ResultParser;
import com.google.zxing.common.GlobalHistogramBinarizer;
import com.google.zxing.common.HybridBinarizer; import com.google.zxing.common.HybridBinarizer;
import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileItem;
@ -249,7 +250,7 @@ public final class DecodeServlet extends HttpServlet {
Result result; Result result;
try { try {
LuminanceSource source = new BufferedImageLuminanceSource(image); LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); BinaryBitmap bitmap = new BinaryBitmap(new GlobalHistogramBinarizer(source));
result = reader.decode(bitmap, HINTS); result = reader.decode(bitmap, HINTS);
} catch (ReaderException re) { } catch (ReaderException re) {
log.info("DECODE FAILED: " + re.toString()); log.info("DECODE FAILED: " + re.toString());