fix: calculate stride correctly
This commit is contained in:
parent
44e4675d2f
commit
a7bc19b380
|
@ -34,7 +34,7 @@ internal static class WebPHelper {
|
|||
decoderConfig.output.colorSpace = WebpCspMode.ModeRgba;
|
||||
decoderConfig.output.isExternalMemory = 1;
|
||||
decoderConfig.output.u.Rgba.size = (nuint) rgba.Length;
|
||||
decoderConfig.output.u.Rgba.stride = height * 4;
|
||||
decoderConfig.output.u.Rgba.stride = width * 4;
|
||||
fixed (byte* rgbaPtr = rgba) {
|
||||
decoderConfig.output.u.Rgba.rgba = (nint) rgbaPtr;
|
||||
var code = Native.WebPDecode((nint) imagePtr, imageBytes.Length, ref decoderConfig);
|
||||
|
|
Loading…
Reference in New Issue