Browse Source

Remove not needed image parameter from CalculateBitDepth

pull/1574/head
Brian Popow 6 years ago
parent
commit
ca8b89789c
  1. 4
      src/ImageSharp/Formats/Png/PngEncoderCore.cs
  2. 2
      src/ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs

4
src/ImageSharp/Formats/Png/PngEncoderCore.cs

@ -227,12 +227,12 @@ namespace SixLabors.ImageSharp.Formats.Png
if (this.options.MakeTransparentBlack)
{
quantized = PngEncoderOptionsHelpers.CreateQuantizedFrame(this.options, clonedImage);
this.bitDepth = PngEncoderOptionsHelpers.CalculateBitDepth(this.options, clonedImage, quantized);
this.bitDepth = PngEncoderOptionsHelpers.CalculateBitDepth(this.options, quantized);
}
else
{
quantized = PngEncoderOptionsHelpers.CreateQuantizedFrame(this.options, image);
this.bitDepth = PngEncoderOptionsHelpers.CalculateBitDepth(this.options, image, quantized);
this.bitDepth = PngEncoderOptionsHelpers.CalculateBitDepth(this.options, quantized);
}
return quantized;

2
src/ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs

@ -89,11 +89,9 @@ namespace SixLabors.ImageSharp.Formats.Png
/// </summary>
/// <typeparam name="TPixel">The type of the pixel.</typeparam>
/// <param name="options">The options.</param>
/// <param name="image">The image.</param>
/// <param name="quantizedFrame">The quantized frame.</param>
public static byte CalculateBitDepth<TPixel>(
PngEncoderOptions options,
Image<TPixel> image,
IndexedImageFrame<TPixel> quantizedFrame)
where TPixel : unmanaged, IPixel<TPixel>
{

Loading…
Cancel
Save