Browse Source

Fix image data size in webpinfo for VP8: 10 bytes are already read during parsing the header

pull/1552/head
Brian Popow 6 years ago
parent
commit
1aca8ad8eb
  1. 2
      src/ImageSharp/Formats/WebP/WebPDecoderCore.cs
  2. 7
      src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs

2
src/ImageSharp/Formats/WebP/WebPDecoderCore.cs

@ -341,7 +341,7 @@ namespace SixLabors.ImageSharp.Formats.WebP
Height = height, Height = height,
BitsPerPixel = features?.Alpha is true ? WebPBitsPerPixel.Pixel32 : WebPBitsPerPixel.Pixel24, BitsPerPixel = features?.Alpha is true ? WebPBitsPerPixel.Pixel32 : WebPBitsPerPixel.Pixel24,
IsLossLess = false, IsLossLess = false,
ImageDataSize = dataSize, ImageDataSize = dataSize - 10, // 10 bytes are read here in the header already.
Features = features, Features = features,
Vp8Profile = (sbyte)version Vp8Profile = (sbyte)version
}; };

7
src/ImageSharp/Formats/WebP/WebPLossyDecoder.cs

@ -60,13 +60,6 @@ namespace SixLabors.ImageSharp.Formats.WebP
} }
} }
enum LoopFilter
{
Normal,
Simple,
None
}
struct YUVPixel struct YUVPixel
{ {
public byte Y { get; } public byte Y { get; }

Loading…
Cancel
Save