Rotated DataMatrix 2D barcode not recognized


Our software uses Aspose BarCode for .NET. We have got some problems with rotated DataMatrix 2D barcodes. Please find the example below. There are two files enclosed to this topic (zipped):
barcode_issue.7z (1.0 KB)

  1. barcode_issue.bmp
  2. barcode_issue_rotated.bmp

Both files are almost identical - the only difference is that one of them is rotated.
Checking those images with online barcode reader
the first one (barcode_issue.bmp) is recognized correctly while the second (barcode_issue_rotated.bmp) is not recognized.

We were using the previous version of your library (7.2.0) and it was working fine and we were getting both images recognized correctly. As we verified, it was possible until 8.0.0 version. Any newer version of Aspose DLL (>8.0.0) is not able to read this barcode (barcode_issue_rotated.bmp) correctly.

Could you please help us to solve this issue?

Best Regards,


Thanks for the sample barcode image files.

Please try to set QualitySettings to MaxBarCodes to get all possible barcodes. See the following sample code that works with rotated data matrix barcode as I tested:
Sample code:

var bmp1 = new Bitmap("g:\\test2\\barcode_issue_rotated.bmp");
using (Aspose.BarCode.BarCodeRecognition.BarCodeReader reader1 = new Aspose.BarCode.BarCodeRecognition.BarCodeReader(bmp1, Aspose.BarCode.BarCodeRecognition.DecodeType.AllSupportedTypes))
        reader1.QualitySettings = Aspose.BarCode.BarCodeRecognition.QualitySettings.MaxBarCodes;

     foreach (Aspose.BarCode.BarCodeRecognition.BarCodeResult result1 in reader1.ReadBarCodes())
             // Read symbology type and code text
            Console.WriteLine("Symbology Type: " + result1.CodeType);
            Console.WriteLine("CodeText: " + result1.CodeText);

Hope, this helps a bit.

using (BarCodeReader reader = new BarCodeReader(@"d:\save\rec\this.bmp", DecodeType.DataMatrix))
    reader.QualitySettings.AllowMedianSmoothing = true;
    reader.QualitySettings.MedianSmoothingWindowSize = 3;
    foreach (BarCodeResult result in reader.ReadBarCodes())