Browse Source

Ensure colormap cache is cleared

pull/361/head
JimBobSquarePants 8 years ago
parent
commit
f741b3a2a0
  1. 1
      src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs
  2. 1
      src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs
  3. 1
      src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs

1
src/ImageSharp/Quantizers/OctreeQuantizer{TPixel}.cs

@ -61,6 +61,7 @@ namespace SixLabors.ImageSharp.Quantizers
this.colors = (byte)maxColors.Clamp(1, 255);
this.octree = new Octree(this.GetBitsNeededForColorDepth(this.colors));
this.palette = null;
this.colorMap.Clear();
return base.Quantize(image, this.colors);
}

1
src/ImageSharp/Quantizers/PaletteQuantizer{TPixel}.cs

@ -58,6 +58,7 @@ namespace SixLabors.ImageSharp.Quantizers
public override QuantizedImage<TPixel> Quantize(ImageFrame<TPixel> image, int maxColors)
{
Array.Resize(ref this.colors, maxColors.Clamp(1, 255));
this.colorMap.Clear();
return base.Quantize(image, maxColors);
}

1
src/ImageSharp/Quantizers/WuQuantizer{TPixel}.cs

@ -139,6 +139,7 @@ namespace SixLabors.ImageSharp.Quantizers
this.colors = maxColors.Clamp(1, 255);
this.palette = null;
this.colorMap.Clear();
try
{

Loading…
Cancel
Save