An Iconic Affair

by allsparkinfinite on 2026-11-21

Once I had my RSS feed up, I got myself included in the IWCB members directory.
Unfortunately, my chosen icon (aka logo aka favicon) wasn't showing up, with an autogenerated one in its place. And I couldn't let that pass.

Well, actually I did let that pass for like a couple of weeks but hey, this isn't my full-time job.

My Favicon

I put thought and effort into it. I designed it in my head and created it using a random number generator, the opencv library in python, and the text box tool in GIMP. This was before I had any confidence in my drawing skills.
So naturally, I was proud of it. And it not showing up in the members directory was unacceptable.

The Favicon Extractor

Abhinav, the webmaster for IWCB, pointed me to the repository, and to the specific function which extracts the favicon.
This function checks for favicons in the following places, grabbing the first one that exists:

  1. The IWCB website cache (cleared weekly)
  2. A predefined icon if the blog is on Mataroa or Bearblog
  3. The DuckDuckGo favicon cache
  4. Any icons mentioned by the member's website
  5. https://example.com/favicon.ico
  6. The option of last resort, an autogenerated icon

The Error And The Fix

My icon was mentioned in the page HTML in a <link rel="icon" href=...> tag, so it should've been found in step 4. Checking the function line-by-line, I found that the code was attempting to use a non-existent method from the favicon library. The error was failing silently, being in a try/except block.

With a little nudge from Abhinav, I set about writing a patch for the IWCB website. I got it working, tested it on my computer, and it was finally fetching my logo!
Unable to resist showing off my handiwork, I compared the version on my computer with the actual website to see how many others' logos we were now fetching correctly. There were 11 others.
But I was breaking one which wasn't broken before.

More Errors And Their Fix

Apart from the one I broke, two other members had already had broken logos. Just a blank logo, not even the autgenerated one. I found that these websites had seemingly valid logo URLs which actually return an HTML page, and that doesn't cause issues until the page is viewed in a browser.
So I added a Content-Type check for that as well, before asking for my changes to be merged into the main repository.

One Final Error

While checking everyone's logos, I noticed Tanvi had an autogenerated logo, both before and after my fix.
One of the moderators not having a logo on her website? Checking her website, she clearly had a logo. But when I checked the actual HTML being received, I saw something very confusing.

<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22256%22 height=%22256%22 viewBox=%220 0 100 100%22><text x=%2250%%22 y=%2250%%22 dominant-baseline=%22central%22 text-anchor=%22middle%22 font-size=%22110%22>🪭</text></svg>"/>

The href wasn't a URL. There was a genuine emoji right there in all that. Which the browser used as a logo. 🤯

I let her know her icon wasn't showing up, she felt the same indignance I did, and she put a normal URL in her blog.

But How Did It Work In The First Place?

These things are called Data URLs. Instead of a link, they just contain data. In this case, the data is an image in the SVG format, and SVG in turn is just a special implementation of the XML format.
This SVG file defined an image size, placed a text box in the center, and put an emoji in it with an appropriate font size. That information was all the browser needed to create the image and use as an icon.

And I'm gonna go add support for that as well even though there is no remaining user of that feature among the current IWCB members. Just because the predefined icons for Mataroa and Bearblog are also data URLs.