Decode ISMN and ISSN image file using BarCodeReader


#1

Hi ,
I am trying to decode ISMN and ISSN image file using BarCodeReader in java

But For both the types last digit is truncated.

Actual Output :

For ISMN : 979012345678
For ISSN : 977123456789

Expected Output :

For ISMN : 9790123456785
For ISSN : 9771234567898

Aspose Version : 17.01
java Version : 1.6

I have attached my file for your reference . kindly help me .

ISMN.gif (3.3 KB)
ISSN.gif (3.3 KB)


#2

@sabbarish123,

Thanks for the image files.

After an initial test, I am able to reproduce the issue as you mentioned. I found the last digit is truncated for the types.
e.g
Sample code:

String bmp = "f:\files\ISMN.gif";
com.aspose.barcode.barcoderecognition.BarCodeReader reader = new com.aspose.barcode.barcoderecognition.BarCodeReader(bmp, com.aspose.barcode.barcoderecognition.DecodeType.ISMN);
if (reader.read())
{
System.out.println(reader.getCodeText());

}

I have logged a ticket with an id “BARCODENET-37236” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.


#3

@Amjad_Sahi

Thank you very much .

Regards,
sabbarish.sk


#4

@sabbarish123,

You are welcome.


#5

@sabbarish123,

We evaluated your issue further. The legacy behavior of BarCodeReader engine is in slitting codetext and checksum. This behavior spreads on all of EAN13 barcode types like: ISSN, ISBN, ISMN, EAN13. Also, it is better to use EAN13 in decoding types to get barcode without any changes or post-processing like ISSN.

You can obtain the full barcode with checksum by two ways:

  • GetCodeText() + GetCheckSum() methods;
  • GetCodeText(true) - true means add checksum to codetext.

See the example code that works fine for your reference:
e.g
Sample code:

String bmp = "f:\\files\\ISMN.gif";
//String bmp = "f:\\files\\ISSN.gif";
        com.aspose.barcode.barcoderecognition.BarCodeReader reader = new com.aspose.barcode.barcoderecognition.BarCodeReader(bmp, com.aspose.barcode.barcoderecognition.DecodeType.ISMN);
        //com.aspose.barcode.barcoderecognition.BarCodeReader reader = new com.aspose.barcode.barcoderecognition.BarCodeReader(bmp, com.aspose.barcode.barcoderecognition.DecodeType.ISSN);

        if (reader.read())
        {
            String lValue1 = reader.getCodeText() + reader.getCheckSum();
            String lValue2 = reader.getCodeText(true);
            System.out.println(lValue1);
            System.out.println(lValue2);
        } 

Hope, this helps a bit.


#6

@Amjad_Sahi ,

Thanks a lot. and also if i turn off checksum validation like below ,

reader.setChecksumValidation(ChecksumValidation.Off);

full barcode with checksum value is obtained. which is the best way to do it ?


#7

@sabbarish123,

Yes, this is also another way to accomplish the task.


#8

@Amjad_Sahi

Thank you


#9

Without checking checksum the recognition quality drops in several times, so engine in this mode can recognize only high quality barcodes and generates a lot of fake recognitions.