ComputerGhost / FaviconFetcher

Scan a webpage for favicons, or just easily download the one you want.
MIT License
5 stars 3 forks source link

Add support for SVG favicons #15

Open kiddailey opened 1 year ago

kiddailey commented 1 year ago

A number of sites use SVG (mimeType: SVG+XML) for their favicon as an option. Would be nice if we could use that since it can be resized to our perfect dimensions without loss of quality.

<link rel="icon" href="/favicon.svg" type="image/svg+xml">

This should come pretty easily since pull request #9 was merged as SkiaSharp already provides the ability to interpret and render SVGs into bitmaps.

kiddailey commented 7 months ago

I've got this in progress and partially working since SkiaSharp was merged a while back (thanks). It's a little tricky as SVGs can be any size, so technically they always match "PerfectSize," but I have some ideas on how to make it work.

Edit: I ended up abstracting IconImage out a bit since SVG data is not bitmap. Need to clean it up before submitting PR but it works awesome.