From f99ed846ebd0429784422b5bbd960f1bdde380b5 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Mon, 15 Mar 2021 16:09:45 +0100 Subject: [PATCH] Remove not needed EncodeAsync from webp encoder --- .../Formats/WebP/WebpEncoderCore.cs | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/src/ImageSharp/Formats/WebP/WebpEncoderCore.cs b/src/ImageSharp/Formats/WebP/WebpEncoderCore.cs index 66d3c86e46..527d151bb4 100644 --- a/src/ImageSharp/Formats/WebP/WebpEncoderCore.cs +++ b/src/ImageSharp/Formats/WebP/WebpEncoderCore.cs @@ -94,32 +94,5 @@ namespace SixLabors.ImageSharp.Formats.Experimental.Webp enc.Encode(image, stream); } } - - /// - /// Encodes the image to the specified stream from the . - /// - /// The pixel format. - /// The to encode from. - /// The to encode the image data to. - /// The token to monitor for cancellation requests. - public async Task EncodeAsync(Image image, Stream stream, CancellationToken cancellationToken) - where TPixel : unmanaged, IPixel - { - this.configuration = image.GetConfiguration(); - - if (stream.CanSeek) - { - this.Encode(image, stream, cancellationToken); - } - else - { - using (var ms = new MemoryStream()) - { - this.Encode(image, ms, cancellationToken); - ms.Position = 0; - await ms.CopyToAsync(stream, this.configuration.StreamProcessingBufferSize, cancellationToken).ConfigureAwait(false); - } - } - } } }