Skip to content

Don't blow up tiny images (favicons/logos/avatars) as the article hero #115

Description

@shellen

Problem

When an article has no real lead image, small images — favicons, site logos, author avatars — end up scaled up as the hero at the top of the post. A 32–64px image stretched into the hero slot looks blurry and wrong.

Nothing in either pipeline checks actual image dimensions:

  1. Hero render (viewer/04-article.js ~line 912): any meta.thumbnail becomes the full-width hero. The frontmatter image: comes from the extractor's og:image/twitter:image fallback (src/extractor.ts ~line 714) — some sites' og:image IS their logo/favicon, and it gets rez'd up regardless of size.
  2. Card/list image fallback (src/viewer.ts ~line 468): when frontmatter has no thumbnail, listFiles grabs the first body image filtered only by URL heuristics (w=\d{1,2}, /pixel|beacon|badge|icon/, feedburner, small gif/svg). Tiny images whose URLs don't match those patterns (avatars, inline emoji, logos without "icon" in the path) slip through and become the card image — which the Rundown deck and dash cards then display large.

Likely more visible since 0.5.1: the hero-dedup fix (#113) means heroes actually render now, so previously-invisible bad thumbnails are on screen.

Fix shape

Client-side dimension gate is the cheap, reliable half: on hero (and dash-card) <img> load, check naturalWidth/naturalHeight — below a threshold (e.g. <200px wide, or tiny-and-square like a favicon), hide the container instead of scaling up (same pattern as the existing onerror handlers). Optionally also skip URLs under /favicons/ and obvious favicon.*/apple-touch-icon filenames at pick time in listFiles.

No image beats a blurry rez'd-up favicon — fall back to the existing no-image treatment (initials/color block in cards, no hero in reader).

Filed by Claude Code on behalf of @shellen.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions