◉CLAUDE LABJP
●2.1.312 — Fixes Claude overwriting very large CLAUDE.md files and skills going missing after a Bash cd●2.1.307 — Fixes MCP failing to reconnect after sleep or a keychain lock (10/21). 2.1.306 also fixed the false claude -p login message●SONNET 4.5 — Retires on the Claude API on 11/30, 32 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●API — In API version 2026-10-21, passing temperature, top_p or top_k returns a 400 error●NEW — I Put a Ten-Line Promise File at the To…●2.1.312 — Fixes Claude overwriting very large CLAUDE.md files and skills going missing after a Bash cd●2.1.307 — Fixes MCP failing to reconnect after sleep or a keychain lock (10/21). 2.1.306 also fixed the false claude -p login message●SONNET 4.5 — Retires on the Claude API on 11/30, 32 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●API — In API version 2026-10-21, passing temperature, top_p or top_k returns a 400 error●NEW — I Put a Ten-Line Promise File at the To…
Articles/Cowork
◈ Cowork/2026-10-29Advanced

When a Share Card Lost Its Bottom Edge: Checking OG Images by Pixels, Not by Declaration, Before the Build

An OG image I had already fixed went back to 1200×1200, and the site name and tagline at the bottom were cut off in wide social cards. These are the checks I lined up before the build: declared size versus real file, the band lost to cropping, and a crawler-style request.

OGP3og:imagesummary_large_imagePillowprebuildClaude Code279Python28

✦ Premium Article

When I shared one of my own articles on social media, the bottom of the card was missing. The band where I had placed the site name and tagline was simply gone.

The image itself was fine. Opened in a browser, it showed everything down to the last row. The meta tags said 1200×630, too. Yet the card was cut. What explained the gap was that the numbers in the meta tags are only a declaration, and have nothing to do with the real dimensions of the file.

Here is the conclusion up front. Check an og:image by the numbers you get from opening the image file, not the numbers written in the HTML. And check before the build, because after sharing is too late.

What had happened

I had already fixed this site's OG images once, to a wide 1200×630. Twitter/X, Facebook, Slack and note.com embeds all assume a wide card, and I had set twitter:card to summary_large_image. I believed it was settled.

Then the real size went back to 1200×1200. I have no record of how it went back. All I know is the result: in a wide card the middle gets cropped, and the site name and tagline at the bottom disappeared. By October 23 I had rebuilt them as separate Japanese and English 1200×630 files.

I can't pin down the cause now. But there are other places that want a square image: a Stripe product image, a LINE thumbnail. As long as those exist, there will be occasions to export the same artwork as a square. If one of those lands in the OG folder, the same thing happens again.

So before the fix, what I needed was a way to notice when it goes back.

How much does cropping take away?

A wide card is shown at roughly 1.91 : 1 (width to height). Here is what a center crop at that ratio does to a 1200×1200 image.

Source imageRows keptRows lostWhere
1200×1200628572286 at the top and 286 at the bottom
1200×63062821 at the top and 1 at the bottom

Hand over a square and almost half the height (47.7%) disappears. The bottom 286 rows are right in the middle of the band where a site name usually sits. Platforms may crop in slightly different ways, but I treat "the bottom edge is not safe" as true everywhere.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You can add a pre-build check that reads the real pixels of an og:image file instead of trusting the width and height written in the HTML
✦You can tell, before opening the image, which rows a wide-card crop will throw away and whether any text sits in them
✦You can stop an image from silently drifting back to its old size by catching it in the build, before anyone shares a broken card
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ Cowork2026-10-29
When Only the Back Half of a Subfolder CLAUDE.md Is Ignored, Count Characters, Not Bytes
Since Claude Code 2.1.309, a subfolder CLAUDE.md and path-scoped rules have a character limit, and anything past it is not handed over. This note covers a counting trap I hit on my own files, a scan script, a pre-commit guard, and how to split a file into rules.
◈ Cowork2026-10-26
I Linted 36 Unattended-Run Prompts: All 7 'Use This Tool' Hits Turned Out to Be Bans
One permission dialog is enough to stall an unattended task, because nobody is there to click it. This note covers a lint script that counts prompt lines that tell the task to use such a tool, why a banned-word grep gave seven false alarms, and how matching on word stems fixed it.
◈ Cowork2026-10-25
The Build Stopped on 'Duplicate Resources' — 80+ Conflicted Copies Came From Build Output in a Synced Folder
An Android project inside Dropbox stopped building with a duplicate-resource error. This note covers a scan script that counts the conflicted copies, a pre-build guard that cleans only generated files, and how to exclude folders from sync.