Skip to content

Commit 5c5dbf2

Browse files
Merge pull request #1727 from VictoriousRaptor/FixImageCache
Fix ImageCache when loading full image
2 parents f42f87c + 25ec843 commit 5c5dbf2

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

Flow.Launcher.Infrastructure/Image/ImageCache.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using System;
1+
using System;
22
using System.Collections.Concurrent;
33
using System.Collections.Generic;
44
using System.Linq;
55
using System.Threading;
6-
using System.Threading.Tasks;
76
using System.Windows.Media;
87

98
namespace Flow.Launcher.Infrastructure.Image

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private static BitmapSource GetThumbnail(string path, ThumbnailOptions option =
248248

249249
public static bool CacheContainImage(string path, bool loadFullImage = false)
250250
{
251-
return ImageCache.ContainsKey(path, false) && ImageCache[path, loadFullImage] != null;
251+
return ImageCache.ContainsKey(path, loadFullImage);
252252
}
253253

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

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

285281
// update cache
286-
ImageCache[path, false] = img;
282+
ImageCache[path, loadFullImage] = img;
287283
}
288284

289285
return img;

0 commit comments

Comments
 (0)