mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Implemented user image cache update on settings update
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user