◉ANTIGRAVITY LABJP
Articles/Tips & Best Practices
✦ Tips & Best Practices/2026-11-26Intermediate

Catching a Cropped Logo in Link Previews Twice, Before and After the OGP Image Is Exported

I sent the URL of a site I had built to a chat, and the link card cut off the last letter of the logo. Two things caused it: the source image was exported broken, and the card crops the left and right edges. Here is the placement check I put in the generator, a check that counts pixels in the exported file, a fetch from the crawler's side, and what to do when an old preview refuses to go away.

OGPlink previewPillowPython29Next.js11web developmentindie development34Antigravity425

✦ Premium Article

It was the week I launched a site I had built for an artist client. To check it, I sent the URL to a chat with only myself in it. The card appeared. But on the right side of the image, the logo stopped halfway through its last letter.

My first thought was that LINE was doing something to it, shrinking the image to fit the card. When I opened public/ogp.png at full size, I found I was only half right. In the 1200×630 source image itself, the logo had already run off the right edge of the canvas.

As an indie developer building and running my own sites, I tend to launch with a "temporary" OGP image still in place. I had never once looked at that placeholder's output at full size. What follows is the two causes I found and the shape my checks have taken since.

The short version

A cropped OGP image comes from two things at once: the exported file is broken, and the card crops the sides. Fix only one and the other still cuts the logo.

  • At export: the generator measures the text and logo it places, and refuses to save if anything leaves the center square.
  • After export: count the pixels in the finished JPEG and find where anything other than the background appears. This catches glows and soft edges the generator never measured.
  • From the sharing side: fetch the page and image with crawler User-Agents and confirm a 200 with no redirects.

Even after all three pass, an old card can linger in a chat. What I changed then was not the image URL but the page URL. The reason is further down.

What actually happened

There were two causes.

The first was the source image. When I made the placeholder, I placed the logo by a fixed coordinate from the top left without measuring its width. When the font changed, the text got wider and the last letter slid off the canvas. The script raised no error. It wrote the broken image without complaint.

The second was how the card displays it. A chat link card does not necessarily show a 1200×630 (1.91:1) image at its own ratio; it crops the left and right to fit the card. It is safest to assume X, Facebook, Slack, and Discord each crop to their own ratios. I have only confirmed this on LINE on a real device, and I have not verified the other services' ratios.

So even with the source fixed, a design that pushes the logo to the right would still be cut by the card. It took me a while to see these as two separate problems.

✦

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
✦Before you swap an OGP image, you can tell from a script's output alone whether the logo or name sits where a share card will crop it
✦Every export now produces a center square and a 300px-wide thumbnail, so you can check in under a minute whether the name is readable in a chat
✦When an old preview will not go away, you will know whether to change the image URL or the page URL
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

Antigravity 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

✦ Tips2026-11-19
Before an Agent Clones Your Template Repo, Hand It a Trap Index: One Line per Fix, the Reasons Kept in One Place
When you copy a running site to start the next one, an agent carries the fixes over but leaves the reasons behind. A symptom-first trap index, a one-page porting plan written before the copy, and three small scripts that catch drift between the index, the source docs and their mirrors.
✦ Tips2026-10-23
594 Articles Had No Body-Link Entrance. Counting the Related-Articles Box Left Only 6 Truly Orphaned
Counting only body links made half my MDX site look orphaned. Here is the full Python script that mirrors the related-articles scoring and also catches links the build strips.
✦ Tips2026-11-17
Why a Small sizes Value Shrinks the Image Itself, and the CSS Line to Add When width and height Attributes Stretch It
The day I added responsive images, one artwork shrank and another stretched sideways. How sizes sets the displayed size, the one CSS line for width and height attributes, and how to work out sizes for tall art in a frame, with numbers and a check script.