Reputation: 10073
This 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.
Upvotes: 0
Views: 941