0

This barcode:

Sample Barcode

Will not decode. What is wrong with that image that it will not decode.

string barcodePng = "tmp.png"; reader = new BarcodeReader(); reader.Options.PossibleFormats = new List<BarcodeFormat>(); reader.Options.PossibleFormats.Add(BarcodeFormat.CODE_39); reader.Options.TryHarder = true; using (var barcodeBitmap = new Bitmap(barcodePng)) { var result = reader.Decode(barcodeBitmap); if (result != null) { Console.WriteLine("barcode did not decode"); } } 

This one is different from other thousands of other images that did decode in that I had to repair the original .tif file that it was cut from because it was damaged. I repaired it by converting it to .pdf and back to .tif.

3
  • Some bars merged due to low resolution/blurring. Commented Oct 20, 2018 at 20:05
  • 1
    I assume this is Code 39; compare your image to the valid barcode for the same data. Commented Oct 20, 2018 at 20:11
  • I voted you up for providing an image of a valid one. I will try repairing image a different way that will not blur the image. Commented Oct 20, 2018 at 20:16

1 Answer 1

1

What is wrong with that image that it will not decode.

It will not decode because some bars have merged and/or changed their widths due to low resolution and blurring.

Assuming the symbology is Code 39, the valid barcode looks like this:

Sign up to request clarification or add additional context in comments.

1 Comment

To fix the image I converted to .pdf with a different print option. I turned off the "sharpen" option on the print driver.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.