From 4830988c555815e7ccbc40ef2f4bfb4a292a942f Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Mon, 2 Dec 2024 13:54:07 +0800 Subject: [PATCH] Add image for format not supported images --- Flow.Launcher.Infrastructure/Constant.cs | 1 + .../Image/ImageLoader.cs | 3 ++- Flow.Launcher/Images/no_image.png | Bin 0 -> 2051 bytes 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Flow.Launcher/Images/no_image.png diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs index 8a95ee79f..c22355495 100644 --- a/Flow.Launcher.Infrastructure/Constant.cs +++ b/Flow.Launcher.Infrastructure/Constant.cs @@ -31,6 +31,7 @@ namespace Flow.Launcher.Infrastructure public static readonly string ErrorIcon = Path.Combine(ImagesDirectory, "app_error.png"); public static readonly string MissingImgIcon = Path.Combine(ImagesDirectory, "app_missing_img.png"); public static readonly string LoadingImgIcon = Path.Combine(ImagesDirectory, "loading.png"); + public static readonly string NoImageIcon = Path.Combine(ImagesDirectory, "no_image.png"); public static string PythonPath; public static string NodePath; diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 4592269a2..10c769ca6 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -22,6 +22,7 @@ namespace Flow.Launcher.Infrastructure.Image private static readonly ConcurrentDictionary GuidToKey = new(); private static IImageHashGenerator _hashGenerator; private static readonly bool EnableImageHash = true; + public static ImageSource NoImage { get; } = new BitmapImage(new Uri(Constant.NoImageIcon)); public static ImageSource MissingImage { get; } = new BitmapImage(new Uri(Constant.MissingImgIcon)); public static ImageSource LoadingImage { get; } = new BitmapImage(new Uri(Constant.LoadingImgIcon)); public const int SmallIconSize = 64; @@ -222,7 +223,7 @@ namespace Flow.Launcher.Infrastructure.Image } catch (NotSupportedException) { - image = null; + image = NoImage; type = ImageType.Error; } } diff --git a/Flow.Launcher/Images/no_image.png b/Flow.Launcher/Images/no_image.png new file mode 100644 index 0000000000000000000000000000000000000000..f8608727beb99f3445488002873532a82030762b GIT binary patch literal 2051 zcmV+e2>kbnP)P&2OC2OQN@VWaM;BVLi7-7 zczD=23Q-+L3B}ihkyqYab3I^d0+69}y*jY~h5&j1;r@uNwfh5e|o!g!xX+^U3Kc3Hh3QFCAk?mjG%b98@W~0;u7D10ypS zc&^qk2)Y5N=9W=%F%DaA6wb~d2A(}^2n1aK)J!d-=zJV`J<(s|a2o?b^8hbTF2gw# zLvBy>cPVrS(XVp^O#}Qb@P8Ec&mz|wSu=$l0bL_#7T_iS66|MZVD&^qQ_!wo1Wf|G z`=ZvRsq=eCze`W@IPEX&>scGSe-2c_0aRHwH z?!T~lBd~OaHywM6e1sZq8D*Cfuzx%wG!%7C@e7^9WP`DzDG0(so+pCJYxDX6D8HJ-ldU|J1{mO!cj|hJCBlH9)m9&5l83_$^sy%*Z_hm05v>NbUub% z%^bCuJ9rch%)&7+hte}43`jsI=?cgKuy#dIadlo>05$wF3J2%#L=#6X=JpUA1G8`r z&Ite{dr$MC2tx;cMvwtu?IZ|E?EsLE^-nZSQA@Tv1jpbUoag3#13*>~8Z{0U#+kB@LmNAjkm7afeZHC8+^`hAGg9#T|xgXb!HS z^#Ka{W`%`W5`sG*3m~T>jB*hK#Q`4sXcB72(isvO?;4It0wCKE0>bm+2t^%!SpXJ- zFq)(Xu=C_3)J#rSL^$Ir8kPq@QryEyMvwzwX%DT5pgh2dNvIWTR~W??;u{7adqKrs zX$Y=%zbt_4w$%|72YB>E5NgEgi3rW#ECAUHDw2xO=9dLPQg%71EI2w)W*Q}z;)(%~Z3qG3IcW%T0L(2s%0?0@0DKTYx|3BOz@9VH!sedR z00KgnGz3SBPZofwnO7d*kq-h$XLi&Fg{u}w^VI?%dqGYK2B=MZ ze%SkGP&#s3bpWy#@c{N-ilh8$Lh}H5o(Kxtq$8*f@X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