Skip to content

Commit b5c4805

Browse files
Fix ImageCache when loading full image
No need to append ImageType to path. loadfullimage==true already indicates that it's a full image.
1 parent 786e3a0 commit b5c4805

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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) && ImageCache[path, loadFullImage] != null;
252252
}
253253

254254
public static async ValueTask<ImageSource> LoadAsync(string path, bool loadFullImage = false)
@@ -259,10 +259,6 @@ public static async ValueTask<ImageSource> LoadAsync(string path, bool loadFullI
259259
if (imageResult.ImageType != ImageType.Error && imageResult.ImageType != ImageType.Cache)
260260
{ // we need to get image hash
261261
string hash = EnableImageHash ? _hashGenerator.GetHashFromImage(img) : null;
262-
if (imageResult.ImageType == ImageType.FullImageFile)
263-
{
264-
path = $"{path}_{ImageType.FullImageFile}";
265-
}
266262
if (hash != null)
267263
{
268264

@@ -278,7 +274,7 @@ public static async ValueTask<ImageSource> LoadAsync(string path, bool loadFullI
278274
}
279275

280276
// update cache
281-
ImageCache[path, false] = img;
277+
ImageCache[path, loadFullImage] = img;
282278
}
283279

284280
return img;

0 commit comments

Comments
 (0)