Closed Bug 914058 Opened 11 years ago Closed 10 years ago

When faced with ICOs with multiple images, the Favicon cache should store multiple resolutions, not just scale the largest.

Categories

(Firefox for Android Graveyard :: Theme and Visual Design, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 748100

People

(Reporter: ckitching, Assigned: ckitching)

References

Details

It was pointed out over in Bug 913878 that the current approach to Favicon decoding in ICOs isn't optimal. As a followup to Bug 748100 (Since that one is already complicated enough), this bug is for investigating making use of the different sizes of image available in an ICO.
While a larger version of the icon scaled down is usually acceptable, often smaller versions of an icon are structurally different, not just downsized versions of the larger companions[1].

The current behaviour of the cache, as of Bug 888326 and But 748100 is that, when an ICO is decoded, the largest icon therein is extracted, downscaled to 128x128 if needed, and stored in the primary cache.
When an icon of a smaller size is required, the 128x128 icon is again downscaled and the result of the downscaling stored in a secondary cache (Which holds references to all scaled and unscaled favicons, and is polled prior to any downscales actually being computed)
This is nice, since it means that we're essentially free to use favicons whereever and however we like at any size that seems appropriate and we'll always make the most of our inputs, in terms of number of pixels - all while avoiding calculating lots of resizes.

Unfortunately, this is liable to end badly in cases where the large favicon is significantly structurally different to the small one and we downscale the large one to satisfy a request for the small one.

What would be maximally effective would be if after satisfying the immediate request, the ICO decoder were to store the encoded ICO in a cache, and decode other chunks of it on demand in response to requests for different sizes. That way, when a request comes in for a smaller image we can be sure to select from the ICO the least largest available image to downscale for the request.

[1]http://msdn.microsoft.com/en-us/library/windows/desktop/aa511280.aspx#detail
Depends on: FaviconRevamp
No longer depends on: 888326
Since the "Scale-the-largest" intermediate solution never actually *landed*, this bug will be fixed by Bug 748100 when it lands.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.