ChecksumException with datamatrix barcode

Skip to first unread message

Diego Dallagiacoma

Jun 17, 2015, 8:31:22 AM6/17/15
I've some trouble with a datamatrix barcode. My java code is as below:

private static String getBarcodeDataDATAMATRIX( BufferedImage bcimage )
throws NotFoundException, ChecksumException, FormatException
LuminanceSource source = new BufferedImageLuminanceSource(bcimage);
BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

Hashtable hints = new Hashtable();
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);

DataMatrixReader reader = new DataMatrixReader();

Result result = reader.decode(bitmap, hints);

String data = result.getText();

return data;

An example of datamatrix is attached.

I used (and I'm using) this code succesfully with a lot of other datamatric barcodes but recently it stopped to work on certain of them (printed on documents received from a particular company): I have always a "ChecksunException".

But when i try to read the same barcode with Zxing BarcodeScanner4.4 android app it works perfectly!
I checked other libraries and some of them are working and some other aren't.

So, i guess that there is something changed/wrong in the barcode I'm reading, but what? Any idea for solve it?

Thanks in advance.

Reply all
Reply to author
0 new messages