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