Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Can't detect DataMatrix unless UPC_E is enabled

Open
#615 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start from the BarcodeReader and DecodingOptions setup in the report, and compare what happens when PossibleFormats is DATA_MATRIX alone versus UPC_E plus DATA_MATRIX. Reproduce with an image containing both a DataMatrix and a Code128 barcode, using TryHarder and AutoRotate as in the report. Done when DataMatrix is found with only DATA_MATRIX enabled, or when the cause of the dependency on UPC_E is identified and explained.

Written by the indexing model from the issue text.

Description

Is there a dependency between UPC_E and DataMatrix? For example with this config ZXing.Net fails to find a DataMatrix barcode in an image that also has a Code128 barcode:

var reader = new BarcodeReader
{
    AutoRotate = true,
    Options = new DecodingOptions
    {
        TryHarder = true,
        PossibleFormats = [
            BarcodeFormat.DATA_MATRIX
        ]
    }
};

However if I use either of these configurations, it finds the DataMatrix:

var reader = new BarcodeReader
{
    AutoRotate = true,
    Options = new DecodingOptions
    {
        TryHarder = true,
        PossibleFormats = [
            BarcodeFormat.UPC_E,
            BarcodeFormat.DATA_MATRIX
        ]
    }
};
var reader = new BarcodeReader
{
    AutoRotate = true,
    Options = new DecodingOptions
    {
        TryHarder = true
    }
};

I'd prefer to only enable the barcodes I'm interested in for efficiency, but leaving everything enabled is a workaround. ZXing.Net does find a UPC_E barcode in the image, but it's a false positive.

Dominant language
C#
Stars
3.1k
Forks
704
Avg merge
13d 17h
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from micjahn/ZXing.Net

All issues in micjahn/ZXing.Net

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.