Skip to content

Commit

Permalink
GetPngFormat logging
Browse files Browse the repository at this point in the history
  • Loading branch information
N00MKRAD committed Oct 12, 2020
1 parent 10e71cf commit 1d3b5f5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Code/ImageUtils/ImageProcessing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1d3b5f5

Please sign in to comment.