From d304c7721471fdf0899ff8b386da5eaf7c0bb50e Mon Sep 17 00:00:00 2001 From: Sheyne Anderson Date: Thu, 3 Oct 2019 12:28:22 +0100 Subject: [PATCH] Fix StyleCop issues --- src/ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs b/src/ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs index 1b6330a3c..a5a45a684 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderOptionsHelpers.cs @@ -166,22 +166,27 @@ namespace SixLabors.ImageSharp.Formats.Png { return PngColorType.GrayscaleWithAlpha; } + if (tPixel == typeof(Argb32)) { return PngColorType.RgbWithAlpha; } + if (tPixel == typeof(Rgb24)) { return PngColorType.Rgb; } + if (tPixel == typeof(Gray16)) { return PngColorType.Grayscale; } + if (tPixel == typeof(Gray8)) { return PngColorType.Grayscale; } + return default; } @@ -199,22 +204,27 @@ namespace SixLabors.ImageSharp.Formats.Png { return PngBitDepth.Bit8; } + if (tPixel == typeof(Argb32)) { return PngBitDepth.Bit8; } + if (tPixel == typeof(Rgb24)) { return PngBitDepth.Bit8; } + if (tPixel == typeof(Gray16)) { return PngBitDepth.Bit16; } + if (tPixel == typeof(Gray8)) { return PngBitDepth.Bit8; } + return default; } }