From 57d0793130a3a71dd896df6bd8e2696fefa9a190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Foidl?= Date: Sat, 25 Mar 2023 23:04:02 +0100 Subject: [PATCH] Fixed build warnings / errors --- src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs | 2 +- src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs | 6 +++--- src/ImageSharp/Formats/Webp/WebpDecoderCore.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs index 3c383e7766..83a828caaf 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs @@ -125,7 +125,7 @@ internal sealed class JpegDecoderCore : IRawJpegData, IImageDecoderInternals } /// - /// The only supported precision + /// Gets the only supported precisions /// // Refers to assembly's static data segment, no allocation occurs. private static ReadOnlySpan SupportedPrecisions => new byte[] { 8, 12 }; diff --git a/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs b/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs index cb13825bc2..7952b15b44 100644 --- a/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs +++ b/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs @@ -361,6 +361,9 @@ internal sealed class WebpLossyDecoder } } + Span scratch = stackalloc int[16]; + Span scratchBytes = stackalloc byte[4]; + // Reconstruct one row. for (int mbx = 0; mbx < dec.MbWidth; mbx++) { @@ -399,9 +402,6 @@ internal sealed class WebpLossyDecoder topYuv.V.CopyTo(yuv[(vOff - WebpConstants.Bps)..]); } - Span scratch = stackalloc int[16]; - Span scratchBytes = stackalloc byte[4]; - // Predict and add residuals. if (block.IsI4x4) { diff --git a/src/ImageSharp/Formats/Webp/WebpDecoderCore.cs b/src/ImageSharp/Formats/Webp/WebpDecoderCore.cs index 0d19dda023..223e15a0e7 100644 --- a/src/ImageSharp/Formats/Webp/WebpDecoderCore.cs +++ b/src/ImageSharp/Formats/Webp/WebpDecoderCore.cs @@ -228,7 +228,7 @@ internal sealed class WebpDecoderCore : IImageDecoderInternals, IDisposable /// The chunk type. /// The webp image features. /// For identify, the alpha data should not be read. - /// Temporary buffer. + /// Temporary buffer. /// true, if its a alpha chunk. private bool ParseOptionalExtendedChunks( BufferedReadStream stream,