At all dpi's I get different results
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 15/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- computer-vision
Research direction
Start with the reporter's snippet: RenderPageToImage(CurrentPage, Dpi) produces the bitmap, which is passed to BarcodeReader.DecodeMultiple with AutoRotate, TryInverted, TryHarder and a long PossibleFormats list. Reproduce by rendering one PDF page at 72, 96, 150, 200, 300 and 600 dpi and comparing decode results, then check whether the library's binarizer or the format list causes the variation. The issue is open-ended, so done means either a documented approach that finds the barcode across dpi values or a clear explanation of why it cannot be done.
Written by the indexing model from the issue text.
Description
I tried to get the barcode from this page

I tried to get it with this code:
Image currentPageImage = RenderPageToImage(CurrentPage, Dpi);
BarcodeReader barcodeReader = new BarcodeReader()
{
AutoRotate = true,
Options = new ZXing.Common.DecodingOptions()
{
TryInverted = true,
PureBarcode = false,
TryHarder = true,
PossibleFormats = new List<BarcodeFormat>() { BarcodeFormat.AZTEC, BarcodeFormat.CODABAR, BarcodeFormat.CODE_39, BarcodeFormat.CODE_93, BarcodeFormat.CODE_128, BarcodeFormat.DATA_MATRIX, BarcodeFormat.EAN_8, BarcodeFormat.EAN_13, BarcodeFormat.ITF, BarcodeFormat.MAXICODE, BarcodeFormat.PDF_417, BarcodeFormat.QR_CODE, BarcodeFormat.RSS_14, BarcodeFormat.RSS_EXPANDED, BarcodeFormat.UPC_A, BarcodeFormat.UPC_E, BarcodeFormat.All_1D, BarcodeFormat.UPC_EAN_EXTENSION, BarcodeFormat.MSI, BarcodeFormat.PLESSEY, BarcodeFormat.IMB, BarcodeFormat.PHARMA_CODE }
}
};
Result[] results = barcodeReader.DecodeMultiple((Bitmap)currentPageImage);
Result = string.Empty;
if (results != null)
{
foreach (Result result in results)
{
Result += result.Text + Environment.NewLine;
}
}
If I now use 72 dpi (standard PDF dpi) I get no results.
If I use 96 dpi (standard WPF dpi) I get = [95001, 6, 3]
150 dpi = [6, 9, 11117131, 7, 3, 8000, 4]
200 dpi = [14, 00800000000, 3, 6, 000, 00000000, 7, 35, 9, 4]
300 dpi = [6, 4, 3]
600 dpi = [6, 3, 8, 5, 7, 4]
So my question would be: "How can I get this barcode if I do NOT know in which codec it was printed?"
We get different PDF documents and have to scan them for all barcodes.
How could I achieve that or is it even possible with this library?
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from micjahn/ZXing.Net
-
crop() overrides document "0 <= top <= Height"; should be top < Height like left < WidthPossibly taken @hidingmyname claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 3/5 Half a day Newbie friendliness 22/100
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
Difficulty 4/5 3-5 days Newbie friendliness 12/100
All issues in micjahn/ZXing.Net
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug mac アプリ: コード アプリ: チャット 優先: 中 要トリアージ
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
yksr-melt/Meltype#1346 · 2 comments ·
Maintainers usually reply within 1 day
-
Collect corrected translations in the app, with no GitHub account and the least possible frictionOpenlocalization medium ui
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
hexide-io/HexIDE#2819 · 1 comment ·
Maintainers usually reply within 1 day