ComputerGhost / FaviconFetcher

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

Proportionally resize with save functionality #24

Closed kiddailey closed 5 months ago

kiddailey commented 5 months ago

In regards to #19, this minor improvement augments the IconImage.Save() method in a non-breaking manner, allowing the caller to proportionally scale an IconImage as needed to fit within a given dimension on save.

Unit tests and supporting test images are included along with the test image Affinity Photo workup file.

kiddailey commented 5 months ago

Dawned on me that if a perfect size is returned from a fetch and the save method uses the same dimensions, we should short circuit the resize. SKBitmap.Resize() may already do this check, but probably better to handle ourselves as bitmaps are immutable.

kiddailey commented 5 months ago

I'm going to close this one and include this change with the SVG support instead as I needed it for unit testing purposes.