So, favicons can be either PNG, GIF, ICO, or SVG. (I’m adding favicon support to my feed reader, and Imagick was acting all weird. I’m cheating, too, by using DuckDuckGo’s favicon service, which unfortunately does not return proper MIME types.)


As such, I’m having Imagick read the image data (works for all but ICO), and if that fails, use `Imagick::setFormat(‘ico’)`. And it works! (Except for, well, emoji inside SVGs. A total edge case, I hope, but I’ve got a plan regardless.)


The “plan” was to set an emoji font before having Imagick read the SVG, but that doesn’t seem to do much at all (on my instance).

I’ve since encountered two blogs that use SVGs with a single plain-text emoji in it as their favicons. Might (eventually) just try and swap out these for an actual image, then work off that (or stick with raw SVG).


Current trick: if you’re one of five people using a single-emoji SVG for a favicon, I’m going to just save a Twemoji PNG instead. Done. (Also, if it’s an SVG with any sort of emoji in it, like in a `title` tag: same, as long as we’re talking 1 emoji. 🤷)

Here’s what that looks like (the top entry, obviously).

Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!