Fix Redundance Reference
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
using AMREZ.EOP.Abstractions.Applications.UseCases.Payments.SlipVerification.QrDecode;
|
||||
using SkiaSharp;
|
||||
using ZXing.SkiaSharp;
|
||||
|
||||
namespace AMREZ.EOP.Application.UseCases.Payments.SlipVerification.QrDecode;
|
||||
|
||||
public class ZxingQrDecoder
|
||||
public sealed class ZxingQrDecoder : IQrDecoder
|
||||
{
|
||||
|
||||
public string? TryDecodeText(byte[] imageBytes)
|
||||
{
|
||||
using var bmp = SKBitmap.Decode(imageBytes);
|
||||
if (bmp is null) return null;
|
||||
|
||||
var reader = new BarcodeReader
|
||||
{
|
||||
AutoRotate = true,
|
||||
Options = { TryHarder = true, PossibleFormats = new[] { ZXing.BarcodeFormat.QR_CODE } }
|
||||
};
|
||||
var res = reader.Decode(bmp);
|
||||
return res?.Text;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user