Add code comments

This commit is contained in:
Jack251970 2025-07-14 09:01:59 +08:00
parent 78b4c7db85
commit 19f37f4c3a
2 changed files with 5 additions and 4 deletions

View file

@ -162,7 +162,8 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
if (imageData is not { Length: > 0 })
return;
// Check if the image data is compressed (GZip)
if (imageData.Length > 2 && imageData[0] == 0x1f && imageData[1] == 0x8b)
{
using var inputStream = new MemoryStream(imageData);
@ -171,9 +172,9 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
gZipStream.CopyTo(outputStream);
imageData = outputStream.ToArray();
}
// Convert the image data to WebP format
var webpData = FaviconHelper.TryConvertToWebp(imageData);
if (webpData != null)
{
var faviconPath = Path.Combine(_faviconCacheDir, $"firefox_{domain}_{iconId}.webp");

View file

@ -121,4 +121,4 @@ public static class FaviconHelper
return null;
}
}
}