Code39 barcode - do not decode all barcodes

56 views
Skip to first unread message

shajan thomas

unread,
Jan 22, 2019, 2:10:06 PM1/22/19
to zxing
Attached is a sample tiff file . Always the last barcode is never decoded. I get the result as below

100353878
0
01-14-2019
LROM
HR

Code :

public Result[] getBarcodeResults(BufferedImage image, BarcodeFormat
) {
// bf = BarcodeFormat.CODE_39 passed as argument

LuminanceSource source = new BufferedImageLuminanceSource(image);

BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

List<BarcodeFormat> formatList = new ArrayList<BarcodeFormat>();

formatList.add(bf);

Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>();
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
hints.put(DecodeHintType.POSSIBLE_FORMATS, formatList);
Result[] results = null;
try {
MultiFormatReader multiFormatReader = new MultiFormatReader();

GenericMultipleBarcodeReader reader = new GenericMultipleBarcodeReader(multiFormatReader);
results = reader.decodeMultiple(bitmap, hints);
}
catch (NotFoundException exception) {

}
return results;

}


Any help appreciated

thanks

Shajan

test.tif
Reply all
Reply to author
Forward
0 new messages