Skip to content

feat: blur placeholders for images#22

Merged
benthecoder merged 1 commit into
mainfrom
blur-placeholders
Jul 12, 2026
Merged

feat: blur placeholders for images#22
benthecoder merged 1 commit into
mainfrom
blur-placeholders

Conversation

@benthecoder

Copy link
Copy Markdown
Owner

adds a generated manifest (public/data/image-meta.json, 68KB for 289 images) with real dimensions and a 12px blur data uri per r2 image. post images and the gallery use it for placeholder="blur" and correct aspect ratios; drafts fall back to the old fade-in. rerun pnpm generate:image-meta after publishing new images — it's incremental and only downloads what's missing.

til: next/image inlines blurDataURL into the server html as a css background, so the placeholder is visible on first paint with zero extra requests — that's why it must be a tiny data uri (~200 bytes here) and not a url: a url would defeat the whole point by needing its own round trip.

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Jul 12, 2026 6:48am

@benthecoder
benthecoder merged commit db5a7e5 into main Jul 12, 2026
2 of 3 checks passed
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.

1 participant