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

How to detect barcodes when they are arranged horizontally and vertically at the same time?

Open
#593 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Quiet
Tech stack
csharp

Research direction

Start with the BarcodeReader setup and DecodeMultiple call in the reporter's snippet, then reproduce with the three attached images to see which codes are missed. The issue asks two questions, so no change is specified yet. Done means either a documented option for orientation-independent and duplicate reads, or a maintainer-agreed change to DecodingOptions behaviour with a test covering the rotated and duplicated cases.

Written by the indexing model from the issue text.

Description

Hi,

Firstly, sorry to post this as an issue (I know this is not a bug), but I don't found a official community forum for ZXing integration.

I have this 3 situations:
BarCode1.jpg : 2 Barcodes code 128 and 2 Barcodes 39=>All codes are read correctly

Image

CODE_39[39;210;327;210] : ABC-1234
CODE_128[33;105;319;105] : ABC-abc-1234
CODE_128[424;52;600;52] : 123456787
CODE_39[404;213;628;213] : 123456

BarCode2.jpg : 2 Barcodes code 128 (1 horizontal and 1 vertical) and 3 Barcodes 39(1 horizontal and 1 vertical)=>Only horizontal codes are read correctly

Image

CODE_39[39;210;327;210] : ABC-1234
CODE_128[33;105;319;105] : ABC-abc-1234

BarCode3.jpg : 2 Barcodes code 128 (1 horizontal and 1 vertical) and 2 Barcodes 39(2 horizontal and 1 vertical)=>Only horizontal codes are read correctly and the duplicate code was ignored.

Image

CODE_39[39;267;327;267] : ABC-1234
CODE_128[33;133;319;133] : ABC-abc-1234

My code is very simple

private string ScanBarcode(Bitmap bitmap)
{
	Bitmap target;
	var reader = new ZXing.Windows.Compatibility.BarcodeReader()
	{
		AutoRotate = true,
		Options = new DecodingOptions
		{
			TryHarder = true,
			PureBarcode = false,
			ReturnCodabarStartEnd = true,
		}
	};
	Result[] result = reader.DecodeMultiple(bitmap);
	if (result==null) return "not found";
	string barcodeResult = "";
	foreach (var res in result)
	{
		barcodeResult += res.BarcodeFormat.ToString() +"[" +res.ResultPoints[0].X +";"+ res.ResultPoints[0].Y +";" +res.ResultPoints[1].X + ";" + res.ResultPoints[1].Y + "]" + " : " + res.Text + "\r\n";
	}
	return barcodeResult;
}

I'm using ZXing.Windows.Compatibility (0.16.13.0) and ZWing (0.16.10.0)

My questions are
1 - Exists an option to force read all barcodes regardless of orientation?
2 - Exists an option to force read all barcodes regardless of whether they are duplicated?

The case of duplication is weird but we have some forms where the same barcode is duplicated, I think, for redundancy reasons if the form is scratched out, but I would still like to get the position of both barcodes.

Thanks

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.