og.image.sizes-mismatch
og:image:width and og:image:height must be the image's real size
Why it matters
The declared size is what a crawler lays the card out with before it has the file — which is the whole reason to declare it. A wrong one is therefore worse than none: the crawler reserves a shape the image does not have, and the first share, the one that matters most, renders letterboxed or cropped. It is also the declaration that blinds the rest of the catalogue: og.image.ratio reads these two numbers and deliberately refuses to fetch, so an invented 1200×630 scores 1.9 and passes over an image that is square. Found on a site whose cover art is 1024×1024, declared 1200×630 by a library that had never looked at it.
What the finding looks like
The message goflag prints, with example values substituted.
Measure the image, or let the file convention do it
Written for the Next.js App Router. The finding is correct on any stack; only the remedy assumes one.
// app/…/opengraph-image.tsx — `size` is the truth and the declaration at once
export const size = { width: 1200, height: 630 };
// Naming a file instead? Then the numbers are that file's, not a default.
openGraph: { images: [{ url: cover.url, width: cover.width, height: cover.height }] }Says who?
This rule is guideline, and it cites the documents below. Nothing here is goflag’s opinion of what a good page looks like — if you disagree with a finding, this is what you are disagreeing with.
- The Open Graph protocol
ogp.me · vendor-spec
- Sharing — webmasters (Open Graph usage)
Meta · vendor-spec