When the image is parsed by few barcode decoding website I am getting the proper text as below
Barcode type: 8/I2OF5
Barcode value: 100024
But when the same barcode is decode against Zxing API returns the following output
BarCodeText::::::10028847
BarCodeFormat:::UPC_E
The similar behavior happens for most the images with ITF format and wrongly decoded as UPC_E for some reason by Zxing API
Source Sample :
try
{
Reader reader = new MultiFormatReader();
LuminanceSource source = new BufferedImageLuminanceSource(image);
BinaryBitmap bitmap = new BinaryBitmap(
new GlobalHistogramBinarizer(source));
Collection<Result> results = new ArrayList<Result>(2);
try {
// Look for multiple barcodes
MultipleBarcodeReader multiReader = new GenericMultipleBarcodeReader(
reader);
Result[] theResults = multiReader.decodeMultiple(bitmap,
HINTS);
if (theResults != null) {
results.addAll(Arrays.asList(theResults));
}
System.err.println("Collection Size:::" + results.size());
for (Result result : results) {
System.err.println("BarCodeText::::::"
+ result.getText() + "\nBarCodeFormat:::"
+ result.getBarcodeFormat());
Can you someone let me know what is the wrong with code or the API behaviour
Sean,
I have modified the code to use DecodeHintType = POSSIBLE_FORMATS and I added the hints for the reader as well in LINE 71
Also attaching the standalone and the image I am trying to decode
After running the code I get the barcode text as below
BarCodeText::::::10028847
BarCodeFormat:::UPC_E
Can please advise it is a wrong with code or with the image
Can some one run a test on the sample attached image
Sean
I tried decoding the problematic image using the zxing online decoder at the following url
http://zxing.org/w/decode.jspx
I am not using my java code at all to decode the image . The online decoder itself is giving wrong values
}