From 7ff7075e04b6cfad112dfafffc76eee0372e47e5 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Tue, 19 Oct 2021 09:14:06 +0200 Subject: [PATCH] Remove ChunkTypes and Animated flag from metadata --- src/ImageSharp/Formats/WebP/WebpDecoderCore.cs | 5 ++--- src/ImageSharp/Formats/WebP/WebpMetadata.cs | 18 +----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/ImageSharp/Formats/WebP/WebpDecoderCore.cs b/src/ImageSharp/Formats/WebP/WebpDecoderCore.cs index e9c61ee08..db55bcd95 100644 --- a/src/ImageSharp/Formats/WebP/WebpDecoderCore.cs +++ b/src/ImageSharp/Formats/WebP/WebpDecoderCore.cs @@ -75,7 +75,7 @@ namespace SixLabors.ImageSharp.Formats.Webp /// /// Gets the dimensions of the image. /// - public Size Dimensions => new Size((int)this.webImageInfo.Width, (int)this.webImageInfo.Height); + public Size Dimensions => new((int)this.webImageInfo.Width, (int)this.webImageInfo.Height); /// public Image Decode(BufferedReadStream stream, CancellationToken cancellationToken) @@ -441,7 +441,7 @@ namespace SixLabors.ImageSharp.Formats.Webp break; case WebpChunkType.Animation: - this.webpMetadata.Animated = true; + // TODO: Decoding animation is not implemented yet. break; case WebpChunkType.Alpha: @@ -499,7 +499,6 @@ namespace SixLabors.ImageSharp.Formats.Webp if (this.currentStream.Read(this.buffer, 0, 4) == 4) { var chunkType = (WebpChunkType)BinaryPrimitives.ReadUInt32BigEndian(this.buffer); - this.webpMetadata.ChunkTypes.Enqueue(chunkType); return chunkType; } diff --git a/src/ImageSharp/Formats/WebP/WebpMetadata.cs b/src/ImageSharp/Formats/WebP/WebpMetadata.cs index 7020a386a..8144d79b5 100644 --- a/src/ImageSharp/Formats/WebP/WebpMetadata.cs +++ b/src/ImageSharp/Formats/WebP/WebpMetadata.cs @@ -1,8 +1,6 @@ // Copyright (c) Six Labors. // Licensed under the Apache License, Version 2.0. -using System.Collections.Generic; - namespace SixLabors.ImageSharp.Formats.Webp { /// @@ -21,27 +19,13 @@ namespace SixLabors.ImageSharp.Formats.Webp /// Initializes a new instance of the class. /// /// The metadata to create an instance from. - private WebpMetadata(WebpMetadata other) - { - this.Animated = other.Animated; - this.Format = other.Format; - } + private WebpMetadata(WebpMetadata other) => this.Format = other.Format; /// /// Gets or sets the webp format used. Either lossless or lossy. /// public WebpFormatType Format { get; set; } - /// - /// Gets all found chunk types ordered by appearance. - /// - public Queue ChunkTypes { get; } = new Queue(); - - /// - /// Gets or sets a value indicating whether the webp file contains an animation. - /// - public bool Animated { get; set; } - /// public IDeepCloneable DeepClone() => new WebpMetadata(this); }