huysentruitw / barcoder

Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.
MIT License
157 stars 37 forks source link

QR Code render thows an exception #30

Closed tinohager closed 3 years ago

tinohager commented 3 years ago

I installed these two packages as described in the documentation, the error thows in my netcoreapp3.1

var barcode = QrEncoder.Encode(qrcode.Content, Barcoder.Qr.ErrorCorrectionLevel.M, Encoding.Auto);
var renderer = new ImageRenderer(imageFormat: Barcoder.Renderer.Image.ImageFormat.Png);

using (var ms = new MemoryStream())
{
    renderer.Render(barcode, ms);
    var imageData = ms.ToArray();
    this._skCanvas.DrawBitmap(SKBitmap.Decode(imageData), x, y);
}

image

huysentruitw commented 3 years ago

This library is still depending on a beta version of the SixLabors.ImageSharp package. I think we should update it to a non-beta release if that's possible before trying anything else.

Apart from that, I think this error can happen when your project also references the same NuGet package, but a different version.

tinohager commented 3 years ago

On a clean project it works.

image