此条码:
不会解码。该图像有什么问题,它不会解码。
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");
}
}
这个与其他数千个确实解码的图像不同,因为我必须修复它被剪切的原始 .tif 文件,因为它已损坏。我通过将其转换为 .pdf 并返回 .tif 来修复它。