public static void ResizeImagePost(string path) { if (!(postScaleMode == Upscale.ScaleMode.Percent && postScaleValue == 100)) // Skip if target scale is 100% { ImgSharpUtils.ResizeImageAdvanced(path, postScaleValue, postScaleMode, postFilter, postOnlyDownscale); Logger.Log("[ImgProc] ResizeImagePost: Resized using ImageSharp"); } }
async Task ProcessImage(string path, string text) { int scale = scaleFactor.GetInt(); Image source = ImgUtils.GetImage(currentSourcePath); int newWidth = source.Width * scale; Logger.Log($"int newWidth ({newWidth}) = source.Width({source.Width}) * scale({scale});"); Upscale.Filter filter = Upscale.Filter.Bicubic; if (Program.currentFilter == FilterType.Point) { filter = Upscale.Filter.NearestNeighbor; } Logger.Log("Scaling image for composition..."); await Task.Delay(1); ImgSharpUtils.ResizeImageAdvanced(path, newWidth, Upscale.ScaleMode.PixelsWidth, filter, false); AddText(path, text); }