Skip to content

Commit 4830988

Browse files
committed
Add image for format not supported images
1 parent c665482 commit 4830988

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

Flow.Launcher.Infrastructure/Constant.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public static class Constant
3131
public static readonly string ErrorIcon = Path.Combine(ImagesDirectory, "app_error.png");
3232
public static readonly string MissingImgIcon = Path.Combine(ImagesDirectory, "app_missing_img.png");
3333
public static readonly string LoadingImgIcon = Path.Combine(ImagesDirectory, "loading.png");
34+
public static readonly string NoImageIcon = Path.Combine(ImagesDirectory, "no_image.png");
3435

3536
public static string PythonPath;
3637
public static string NodePath;

Flow.Launcher.Infrastructure/Image/ImageLoader.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public static class ImageLoader
2222
private static readonly ConcurrentDictionary<string, string> GuidToKey = new();
2323
private static IImageHashGenerator _hashGenerator;
2424
private static readonly bool EnableImageHash = true;
25+
public static ImageSource NoImage { get; } = new BitmapImage(new Uri(Constant.NoImageIcon));
2526
public static ImageSource MissingImage { get; } = new BitmapImage(new Uri(Constant.MissingImgIcon));
2627
public static ImageSource LoadingImage { get; } = new BitmapImage(new Uri(Constant.LoadingImgIcon));
2728
public const int SmallIconSize = 64;
@@ -222,7 +223,7 @@ private static ImageResult GetThumbnailResult(ref string path, bool loadFullImag
222223
}
223224
catch (NotSupportedException)
224225
{
225-
image = null;
226+
image = NoImage;
226227
type = ImageType.Error;
227228
}
228229
}

Flow.Launcher/Images/no_image.png

2 KB
Loading

0 commit comments

Comments
 (0)