Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Flow.Launcher.Infrastructure/Image/ImageCache.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Media;

namespace Flow.Launcher.Infrastructure.Image
Expand Down
8 changes: 2 additions & 6 deletions Flow.Launcher.Infrastructure/Image/ImageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ private static BitmapSource GetThumbnail(string path, ThumbnailOptions option =

public static bool CacheContainImage(string path, bool loadFullImage = false)
{
return ImageCache.ContainsKey(path, false) && ImageCache[path, loadFullImage] != null;
return ImageCache.ContainsKey(path, loadFullImage);
}

public static bool TryGetValue(string path, bool loadFullImage, out ImageSource image)
Expand All @@ -264,10 +264,6 @@ public static async ValueTask<ImageSource> LoadAsync(string path, bool loadFullI
if (imageResult.ImageType != ImageType.Error && imageResult.ImageType != ImageType.Cache)
{ // we need to get image hash
string hash = EnableImageHash ? _hashGenerator.GetHashFromImage(img) : null;
if (imageResult.ImageType == ImageType.FullImageFile)
{
path = $"{path}_{ImageType.FullImageFile}";
}
if (hash != null)
{

Expand All @@ -283,7 +279,7 @@ public static async ValueTask<ImageSource> LoadAsync(string path, bool loadFullI
}

// update cache
ImageCache[path, false] = img;
ImageCache[path, loadFullImage] = img;
}

return img;
Expand Down