declared-size.mismatch

Declared image size does not match the image. Level: Warning.

When it is raised

Raised when the card image loaded, og:image:width and og:image:height are usable numbers, and either differs from the measured image by more than 1 px. The image measured is the card image as resolved from og:image, then og:image:url, twitter:image and twitter:image:src, so on a page with neither og:image nor og:image:url, the declared og:image size is compared with the twitter:image (or twitter:image:src) file. It needs a measured size, so it does not run when the image could not be measured (formats other than PNG, GIF, JPEG and WebP, or a file whose header could not be read). JPEGs with an EXIF orientation of 5 to 8 are measured as displayed, with width and height swapped.

What it does to a shared link

The declared width or height differs from the image file's by more than 1 px. The message gives both sizes, declared first.

How to fix it

  1. Set og:image:width and og:image:height to the image file's dimensions, which the message shows second.
  2. If the image was replaced or resized, update both tags in the same change as the image URL.
  3. For a rotated JPEG, declare the width and height as the image appears when displayed.
<meta property="og:image" content="https://example.com/card.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="630">

Related checks