-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Use case
Display an icon at 64x64, using the best possible quality from the icons available, and always display an icon if any are available.
For example, let us say that I specify the following:
- Min Size: 16
- Max Size: 200
- Perfect Size: 64
And let's also say that a site provides the following icon types:
- 16x16 favicon
- 120x120 apple-touch-icon
For the request with my above min/max/perfect parameter, FaviconFetcher will return the 16x16 image due to the distance calculation:
Queue
| Size | Distance |
|---|---|
| 16x16 | -67.88 |
| 120x120 | -79.20 |
However, in this sample use-case, scaling the 16x16 up to 64x64 would look terrible, especially when a much better result would come from scaling down the 120x120.
Feature Request
- Provide a way to specify that FaviconFetcher should return the closest larger icon (vs just the closest), OR
- Provide a way to specify that FaviconFetcher should select the closest larger icon, scale it down to PerfectSize, and return that result
Alternatives
-
Consumer could specify a larger MinSize
- Pro: No code change
- Con: If no sizes larger than MinSize are available, no icon is returned even if smaller ones exist
-
Consumer could ask for a large Max/PerfectSize and perform a scale down on the fetch result separately
- Pro: No code change
- Pro: Gives consumer some control over size/quality
- Con: Won't work in all cases depending on distance calculation, must ask for very large perfect size
- Con: Allocates more resources to perform scale
- Con: "PerfectSize" doesn't mean perfect size anymore
-
Consumer could ask for a large Max/PerfectSize and embed result directly
- Pro: No code change
- Pro: Gives consumer some control over size/quality
- Con: Won't work in all cases depending on distance calculation, must ask for very large perfect size
- Con: Uses more resources to display larger-than-necessary image
- Con: "PerfectSize" doesn't mean perfect size anymore
Thoughts?