Problem with EAN13 checksum handling + performance degradation

Hi,

We found some wierd behaviors with the latest Aspose.Barcode release (5.3.0) during our regression test.

1)
The first problem is, that the handling of EAN13 checksum verification works differently in 5.3.0 and in 3.0.0. With 3.0.0, everything worked fine as the recognized barcode text always contained the checksum regardless the value of VerifyChecksum property. With 5.3.0, the checksum is not included in the recognized text when I turn on the chechsum validation.


I created a simple test application and get the following results:

In case of 5.3.0, the recognized text is the following: 240736900180 (when ChecksumValidation=default)
In case of 5.3.0, the recognized text is the following: 240736900180 (when ChecksumValidation=on)
In case of 5.3.0, the recognized text is the following: 2407369001804 (when ChecksumValidation=off)


In case of 3.0.0, the recognized text is the following: 2407369001804 (when VerifyChecksum=true)
In case of 3.0.0, the recognized text is the following: 2407369001804 (when VerifyChecksum=false)

2)
We thought that the checksum was removed from the recognized text intentionally and it can be retrieved by calling the GetCheckSum() method of BarCodeReader however that method always returned empty string. According to the EAN standards, the checksum should be always verified and included in the recogized text.

3)
We realized that there is a quite significant performance degradation in the 5.x.0 versions compared to 3.0.0. According to my simple test application 3.0.0 is about 2-4 times faster than 5.3.0 (in most cases).


My questions are:
1) Are there any way to fix this? We need a solution where the checksum is verified but not removed from the recognized EAN13 barcode value.
2) Are we missing something that causes GetCheckSum() not to work?
3) Can we do anything to minimize the performance degradation and get similar speed like with 3.0.0


Thanks in advance!


ps: I used the following code fragments for testing:


///
/// For testing 3.0.0 version
///
///
static void Main(string[] args)
{
License license = new License();
license.SetLicense("Aspose.Barcode_old.lic");

Stopwatch sw = Stopwatch.StartNew();
using (BarCodeReader reader = new BarCodeReader())
{
reader.BarCodeReadType = BarCodeReadType.EAN13;
reader.BarCodeImage = (Bitmap)Image.FromFile("..\\..\\..\\TestImage.tif");
reader.VerifyChecksum = true;

BarCodeInfo[] barcodes = reader.Read();
foreach (BarCodeInfo info in barcodes)
{
string codeText = info.CodeText;
string codeType = info.BarCodeReadType.ToString();
Console.WriteLine(codeType + ":" + codeText);
}
}

sw.Stop();

Console.WriteLine("DONE: " + sw.Elapsed.TotalMilliseconds + " ms");
Console.ReadKey();
}


///
/// For testing post 5.0.0 versions.
///
///
static void Main(string[] args)
{
License license = new License();
license.SetLicense("Aspose.Barcode_new.lic");

Stopwatch sw = Stopwatch.StartNew();
using (BarCodeReader reader = new BarCodeReader("..\\..\\..\\TestImage.tif", BarCodeReadType.EAN13))
{
reader.ChecksumValidation = ChecksumValidation.Default;
while (reader.Read())
{
string codeText = reader.GetCodeText();
string codeType = reader.GetReadType().ToString();
string codeChecksum = reader.GetCheckSum();
Console.WriteLine(codeType + ":" + codeText + "," + codeChecksum);
}
}

sw.Stop();

Console.WriteLine("DONE: " + sw.Elapsed.TotalMilliseconds + " ms");
Console.ReadKey();
}


Best regards,
Attila Nagy

Hi Bela,


Thank you for your inquiry. I have tested your provided sample against the latest build of Aspose.BarCode for .NET v5.3.0. I regretfully inform you that the latest version was recognizing EAN13 code without checksum digit. Also, GetCheckSum method returning empty string. This problem has been logged in our bug tracking system under ticket Id BARCODENET-33416. We will soon investigate the cause of incorrect recognition. Also, you will be notified once the fix for your problem is available for public use. Please accept our apologies for your inconvenience.

From your third point, I’m unable to compile your code with Aspose.BarCode for .NET v3.0.0. Can you please share exact version or sample project? It will help us to check the <span style=“font-size:10.0pt;line-height:115%;
font-family:“Arial”,“sans-serif”;mso-fareast-font-family:“Times New Roman”;
color:#333333;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA”>performance degradation.

Thanks for your reply.

You can download my VS2008 test project from the link. In the ZIP file, you can find the DLLs we use (3.0.0 + 5.3.0) and the sample project without licenses.

Hi Bela,


Thank you for your details. I tested your scenario with the latest version of Aspose.BarCode for .NET v5.3.0 and I observed that it takes hardly 2 seconds. Please note that we release a new version of Aspose.BarCode every month. Each new release contains many improvements, bug fixes and new features. So comparing speed has no sense, because these two versions are separated by years, even not months. In addition, we’re working to improve the quality and performance of the component on priority basis. I hope you understand.

Please let me know in case of further assistance and comments.

The issues you have found earlier (filed as BARCODENET-33416) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.