Skip to content

Commit

Permalink
fixed exception thrown on svg files load attempt by SkiaSharp
Browse files Browse the repository at this point in the history
  • Loading branch information
kolya5544 committed Jan 5, 2024
1 parent 10bcadd commit 7960e48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Utilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ public static SKBitmap GetPicture(string url)
{
WebClient web = new WebClient();
byte[] data = web.DownloadData(url);
SKBitmap bmp = SKBitmap.Decode(data);
return bmp;
if (url.EndsWith(".svg"))
{
// SVG files not supported
return new SKBitmap(1, 1, true);
}
return SKBitmap.Decode(data);
}

public static string FindProperty(XmlNodeList nodes, string name, int depth = 0)
Expand Down

0 comments on commit 7960e48

Please sign in to comment.