Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Google's undocumented favicon to png convertor (via) Showing the favicon of a domain next to a link is a really nice trick, but it’s slightly tricky to achieve as IE won’t display a .ico file if you link to it from an img element, so you need to convert the images server-side. This undocumented Google API does that for you, meaning it’s much easier to add favicons as a feature to your site.

5 comments

  1. Interestingly, it seems that if the .ico file has a 32x32px icon Google's thing will make the png from that instead of the conventional 16x16px version. Might cause sub-optimal results if it's used in places that want only 16x16px icons. See, for example, http://www.google.com/s2/favicons?domain=livejourn al.com .

    I also find it interesting that they take 16-colour icons and turn them into 32-bit PNGs. They're still not especially large, but larger than they would be if they were 16-colour.

    Martin Atkins - 30th August 2008 23:37 - #

  2. I've been using this to prettify my friendfeed feed for a few months. Works a treat...

    http://jasoncartwright.com

    Jason - 31st August 2008 09:28 - #

  3. Tried it with a post of mine.

    Now to see if Google closes this open API.

    Shelley - 31st August 2008 17:48 - #

  4. It's a pity it doesn't send caching headers for converted images.

    arty - 3rd September 2008 15:26 - #

  5. Nice feature, but unfortunately this doesn't work if the site has a Favicon defined by a LINK tag that's somewhere other than /favicon.ico.

    Sean O - 4th September 2008 19:51 - #

Sign in with OpenID

Auto-HTML: Line breaks are preserved; URLs will be converted in to links.

Manual XHTML: Enter your own, valid XHTML. Allowed tags are a, p, blockquote, ul, ol, li, dl, dt, dd, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, br, pre

A django site