Implemented user image cache update on settings update

This commit is contained in:
2025-11-20 21:03:48 +01:00
parent 5925f1a0f1
commit 116b47cdc0
2 changed files with 8 additions and 0 deletions

View File

@@ -10,6 +10,7 @@ public static class ImageHelper
public static Dictionary<int, Dictionary<string, byte[]>> ImageCache = [];
public static byte[] ResizeAndConvertToWebp(string imageString, int size = 32)
{
if (imageString.Length == 0) return [];
if (ImageCache.TryGetValue(size, out Dictionary<string, byte[]>? sizeCache)
&& sizeCache.TryGetValue(imageString, out byte[]? result) && result.Length > 0)
{
@@ -49,6 +50,7 @@ public static class ImageHelper
{
ResizeAndConvertToWebp(user.JpegPhoto, 256);
}
Thread.Sleep(10);
}
}
}