From 0b0ead10dc0df254084c4ee3af43a4d1f4c6408f Mon Sep 17 00:00:00 2001 From: NoPlagiarism <37241775+NoPlagiarism@users.noreply.github.com> Date: Mon, 2 Dec 2024 12:20:21 +0500 Subject: [PATCH] [Result] return data uri image support --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 2 +- Flow.Launcher.Plugin/Result.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 612f495be64..231fcfff81b 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -139,7 +139,7 @@ private static async ValueTask LoadInternalAsync(string path, bool return new ImageResult(image, ImageType.ImageFile); } - if (path.StartsWith("data:", StringComparison.OrdinalIgnoreCase)) + if (path.StartsWith("data:image", StringComparison.OrdinalIgnoreCase)) { var imageSource = new BitmapImage(new Uri(path)); imageSource.Freeze(); diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 9b42b102176..027631533a1 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -70,7 +70,8 @@ public string IcoPath && !string.IsNullOrEmpty(PluginDirectory) && !Path.IsPathRooted(value) && !value.StartsWith("http://", StringComparison.OrdinalIgnoreCase) - && !value.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) + && !value.StartsWith("https://", StringComparison.OrdinalIgnoreCase) + && !value.StartsWith("data:image", StringComparison.OrdinalIgnoreCase)) { _icoPath = Path.Combine(PluginDirectory, value); }