Skip to content

Conversation

@brianlovin
Copy link
Owner

Summary

Fixes favicon loading for sites using BMP-only ICO files (ped.ro, evilrabbit.com, mackenziechild.me, stevensarmi.com). Previously, the code only extracted PNG images from ICO files and would fail when encountering BMP-only files.

Changes

  • Added decode-ico package to properly parse and extract both PNG and BMP images
  • Updated extractBestImageFromIco to convert BMP data to PNG via sharp
  • Made the function async to handle image conversion
  • Improved ICO file prioritization in favicon discovery (deprioritize ICO files in favor of other formats)

Testing

Tested with sites containing:

  • BMP-only ICO files (32bpp, 8bpp)
  • PNG files named .ico
  • Successfully extracts and optimizes all variants

🤖 Generated with Claude Code

Previously, ICO files containing only BMP images (like ped.ro, evilrabbit.com, mackenziechild.me) would fail because the code only extracted PNG images. This uses decode-ico to properly parse and extract both PNG and BMP images from ICO files, converting BMP data to PNG via sharp.

Co-Authored-By: Claude Haiku 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
brios Ready Ready Preview, Comment Jan 27, 2026 4:14am

Request Review

@brianlovin brianlovin merged commit f6bef91 into main Jan 27, 2026
3 checks passed
@brianlovin brianlovin deleted the brianlovin/pedro-favicon-fix branch January 27, 2026 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants