Skip to content

Commit

Permalink
Merge pull request Flow-Launcher#3104 from NoPlagiarism/image_data_uri
Browse files Browse the repository at this point in the history
Return data uri image as icon support
  • Loading branch information
VictoriousRaptor authored Dec 5, 2024
2 parents 14f1a5a + 0b0ead1 commit 120b7c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Flow.Launcher.Infrastructure/Image/ImageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private static async ValueTask<ImageResult> 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();
Expand Down
3 changes: 2 additions & 1 deletion Flow.Launcher.Plugin/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 120b7c7

Please sign in to comment.