Twitter:image:width and twitter:image:height have no effect


#1

I’m experimenting with the width and height attributes in Twitter cards. I’ve got a few test pages with different combinations of width and height. They all use the same 333x500 source image.

Test page 1 (original size)

<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@sepiaj_kp">
<meta name="twitter:image" content="https://images-na.ssl-images-amazon.com/images/P/B00IHMEAYK.01.L.jpg">
<meta name="twitter:image:width" content="333">
<meta name="twitter:image:height" content="500">
<meta name="twitter:title" content="Check out this book: &quot;Colorless Tsukuru Tazaki and His Years of Pilgrimage: A novel (Vintage International)&quot; by Haruki Murakami">
<meta name="twitter:description" content="A New York Times #1 Bestseller A New York Times and Washington Post notable book, and one of the Financial Times, St. Louis Post-Dispatch, Slate, Mother Jones, The Da...">

Test page 2 (1x2 size) - same tags as above, except for width and height

<meta name="twitter:image:width" content="250">
<meta name="twitter:image:height" content="500">

Test page 3 (4x3 size)

<meta name="twitter:image:width" content="640">
<meta name="twitter:image:height" content="480">

The resulting Twitter card looks exactly the same for all these pages. The image is not cropped or resized any differently. What am I doing wrong?


#2

Can I ask where you found references to these attributes? We don’t have them in our docs, as far as I can see.


#3

Go to the Twitter Cards documentation, section “Markup Tag Reference”, and scroll down to “twitter:image:width”.


#4

Ah! thanks - we need to update that. As far as I understand it, these values are not used anymore - sorry for the confusion.


#5

These properties seem to have been silently gone from the English document, but still persist (at least) in the Japanese docs.

here:
https://dev.twitter.com/ja/cards/markup

and here:
https://dev.twitter.com/ja/cards/types/photo

Please make updates.

I’d also suggest that deprecated specs should still be documented as such; silently removing them from the docs can be confusing.

Thanks.


#6

I’ll make a note to do that. Unfortunately the Japanese documentation is incomplete and not currently in sync with the English documentation. This is on our backlog to resolve.

The majority of deprecated content is indeed marked as such, but this seems to have slipped through the process.

Appreciate the feedback and apologies for the confusion this has obviously caused.