From 1d3b5f5e711415494be83e001ba27ddac98acf61 Mon Sep 17 00:00:00 2001 From: N00MKRAD Date: Mon, 12 Oct 2020 12:24:17 +0200 Subject: [PATCH] GetPngFormat logging --- Code/ImageUtils/ImageProcessing.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Code/ImageUtils/ImageProcessing.cs b/Code/ImageUtils/ImageProcessing.cs index 88fc7c9..e94ec1f 100644 --- a/Code/ImageUtils/ImageProcessing.cs +++ b/Code/ImageUtils/ImageProcessing.cs @@ -195,10 +195,17 @@ public static async Task ConvertImage(string path, Format format, bool fillAlpha static MagickFormat GetPngFormat (string path) { - if (ImgUtils.GetColorDepth(path) < 24) + int depth = ImgUtils.GetColorDepth(path); + if (depth < 24) + { + Logger.Log($"Color depth of {Path.GetFileName(path)} is {depth}, using Png24 format"); return MagickFormat.Png24; + } else + { + Logger.Log($"Color depth of {Path.GetFileName(path)} is {depth}, using Png32 format for alpha support"); return MagickFormat.Png32; + } } public static async Task PostProcessImage(string path, Format format, bool dontResize)