Forum Moderators: open

Message Too Old, No Replies

displaying windows icons with html

         

budoink

3:43 pm on Mar 31, 2009 (gmt 0)

10+ Year Member



I'm trying to display favicons alongside links in a webpage (currenly using img tags). Is there a way to select which icon is displayed from windows icon files containing multiple sizes?

Firefox seems to always display the smallest icon (16x16) while safari chooses the largest. Specifying a height and width of 16 will ensure that they all appear 16x16 but safari seems to display a scaled version of the largest icon rather than the actual 16x16, which results in a loss of quality.

I've tried searching the forums and google for an anwser, but as you can imagine, use of the keyword favicon or "windows icon" throws up a loads of stuff which is completely unhelpful for this particular problem

Alternatively/additionally is there a way of converting icos to pngs using php? Searching the forums this seems to require ImageMagick which doesn't seem to be available from my webhost.

Thanks in advance to anyone that can help :-)

MichaelBluejay

9:30 pm on Mar 31, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Tell me you're not hotlinking to these icon files? That is, you're not doing this, are you?

<img src=http://SomebodyElsesSite.com/favicon.ico>

If you are, please don't do that. It's not nice to pull in files from other sites when there's not an actual visit. You screw up the other site's traffic reports when you do that, because your request will look like a visit, when it's really not.

I've never tried to display favicons directly on the page so if Safari isn't scaling properly, it does seem that you either have to accept the poorer scaling or copy the favicon file and use software to turn it into a png or gif. If your host doesn't have Image Magick preinstalled, see if you can install it yourself.