From d2b76c751b6e6067c7e095472581a011026a3403 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Sat, 18 Jan 2020 19:48:05 +0100 Subject: [PATCH] Fix image data size in webpinfo for VP8: 10 bytes are already read during parsing the header --- src/ImageSharp/Formats/WebP/WebPDecoderCore.cs | 2 +- src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs b/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs index fafb5e752a..bdc73a939b 100644 --- a/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs +++ b/src/ImageSharp/Formats/WebP/WebPDecoderCore.cs @@ -341,7 +341,7 @@ namespace SixLabors.ImageSharp.Formats.WebP Height = height, BitsPerPixel = features?.Alpha is true ? WebPBitsPerPixel.Pixel32 : WebPBitsPerPixel.Pixel24, IsLossLess = false, - ImageDataSize = dataSize, + ImageDataSize = dataSize - 10, // 10 bytes are read here in the header already. Features = features, Vp8Profile = (sbyte)version }; diff --git a/src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs b/src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs index f01d5d3625..9a1862981b 100644 --- a/src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs +++ b/src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs @@ -60,13 +60,6 @@ namespace SixLabors.ImageSharp.Formats.WebP } } - enum LoopFilter - { - Normal, - Simple, - None - } - struct YUVPixel { public byte Y { get; }