From 1e0abe637f93edd8ee6d8e27685c55a64f4840b6 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 2 Oct 2025 17:14:33 +0200 Subject: [PATCH] ProcessImage Logging --- .../DownloadChapterFromMangaconnectorWorker.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/API/Workers/MangaDownloadWorkers/DownloadChapterFromMangaconnectorWorker.cs b/API/Workers/MangaDownloadWorkers/DownloadChapterFromMangaconnectorWorker.cs index 51867cd..a5b9dc4 100644 --- a/API/Workers/MangaDownloadWorkers/DownloadChapterFromMangaconnectorWorker.cs +++ b/API/Workers/MangaDownloadWorkers/DownloadChapterFromMangaconnectorWorker.cs @@ -183,6 +183,7 @@ public class DownloadChapterFromMangaconnectorWorker(MangaConnectorId c private bool ProcessImage(Stream imageStream, out Stream processedImage) { + Log.Debug("Processing image"); if (!Tranga.Settings.BlackWhiteImages && Tranga.Settings.ImageCompression == 100) { Log.Debug("No processing requested for image"); @@ -194,12 +195,14 @@ public class DownloadChapterFromMangaconnectorWorker(MangaConnectorId c try { using Image image = Image.Load(imageStream); + Log.Debug("Image loaded"); if (Tranga.Settings.BlackWhiteImages) image.Mutate(i => i.ApplyProcessor(new AdaptiveThresholdProcessor())); image.SaveAsJpeg(processedImage, new JpegEncoder() { Quality = Tranga.Settings.ImageCompression }); + Log.Debug("Image processed"); return true; } catch (Exception e) @@ -207,17 +210,17 @@ public class DownloadChapterFromMangaconnectorWorker(MangaConnectorId c if (e is UnknownImageFormatException or NotSupportedException) { //If the Image-Format is not processable by ImageSharp, we can't modify it. - Log.Debug($"Unable to process image: Not supported image format"); + Log.Debug("Unable to process image: Not supported image format"); }else if (e is InvalidImageContentException) { - Log.Debug($"Unable to process image: Invalid Content"); + Log.Debug("Unable to process image: Invalid Content"); } else { Log.Error(e); } + return false; } - return false; } private async Task CopyCoverFromCacheToDownloadLocation(Manga manga)