# 推文不显示图片？

**URL:** https://meta.discourse.org/t/tweets-not-showing-images/84371
**Category:** Bug
**Created:** [2018年四月2日 11:23 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371 "2018-04-02T11:23:39Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)
#### Post date: [2018年四月2日 11:23 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/1 "2018-04-02T11:23:39Z")

</div>

Hi,

I’m trying to understand why tweets won’t show the first image from my post. I suspect I’ve got a setting wrong somewhere, but I can’t figure it out.

To demonstrate, here is an original discourse post:

[https://forum-test.blendernation.com/t/little-big-planet-sackboy/14](https://forum-test.blendernation.com/t/little-big-planet-sackboy/14)

And here’s [a tweet with a link to this post](https://twitter.com/ss_sharing_test/status/980475596445769729). It shows a placeholder image - not even my site logo.

[Here’s a test I did with a link to another Discourse instance](https://twitter.com/ss_sharing_test/status/980766986132164608) - as you can see it correctly features the first image.

Is there some settings magic I need to apply to get this to work?

On a related note, is there a way to change the card format to ‘Summary Card with Large Image’? Since we’re running a graphics-oriented community this would make sense for us.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018年四月2日 15:14 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/2 "2018-04-02T15:14:56Z")

</div>

You must configure the twitter API keys in your site settings for this to work as I recall.

---

<div class="post-metadata">

### Author: ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)
#### Post date: [2018年四月2日 15:21 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/3 "2018-04-02T15:21:13Z")

</div>

Hmm, we haven’t done that on the Sketchfab forum, which shows the images correctly. My hunch is that I’ve misconfigured something else. Also, I think the only available Twitter settings are for authentication?

 ![image](https://global.discourse-cdn.com/meta/original/3X/1/f/1f9a0f5122dd288c9d685650b61b1c033fcbc03f.png)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2018年四月2日 15:21 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/4 "2018-04-02T15:21:48Z")

</div>

The [Twitter Card Validator](https://cards-dev.twitter.com/validator) is showing this warning for the linked post:

```plaintext
WARN: The image URL https://forum-test.blendernation.com/uploads/default/optimized/1X/236bbbe9fa50f882fc710f078b22276a6cb3b974_1_690x483.jpg specified by the 'twitter:image' metatag may be restricted by the site's robots.txt file, which will prevent Twitter from fetching it.

```

Testing this [meta topic](https://meta.discourse.org/t/user-invitation-poking-a-user-to-a-topic-is-now-live/27180/1) however looks good on the validator.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2018年四月2日 15:34 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/6 "2018-04-02T15:34:05Z")

</div>

Okay, I can verify that fresh Discourse installs are not loading image previews on Twitter.

This was regressed 24 days ago in:

[https://github.com/discourse/discourse/commit/0fd622e5d10cdbe9169cfce291729a5596b363eb](https://github.com/discourse/discourse/commit/0fd622e5d10cdbe9169cfce291729a5596b363eb)

Should we revert this commit @codinghorror?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2018年四月2日 15:34 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/7 "2018-04-02T15:34:56Z")

</div>

Sure that seems fine. You might ping that user I think he posted here about it.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2018年四月2日 15:43 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/8 "2018-04-02T15:43:40Z")

</div>

Okay, that commit is now reverted. I couldn’t find Dan’s account here on meta, but I left the comment on PR.

Thanks for bringing this issue to our notice @bartv. 👍

---

<div class="post-metadata">

### Author: ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)
#### Post date: [2018年四月2日 15:47 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/9 "2018-04-02T15:47:42Z")

</div>

Wow that’s very fast indeed! So can I now rebuild + test, or is there something else you guys need to do before this fix is available?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2018年四月2日 15:55 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/10 "2018-04-02T15:55:39Z")

</div>

You will have to wait for commit to land in [tests-passed](https://github.com/discourse/discourse/tree/tests-passed) branch.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2018年四月2日 17:35 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/11 "2018-04-02T17:35:19Z")

</div>

The commit is now landed in `tests-passed` branch and I verified that the issue is fixed now.

 ![49](https://global.discourse-cdn.com/meta/original/3X/2/c/2c93cf188d0dda98776a2e06c8d5406bdf53897f.png)

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [2018年四月2日 17:37 UTC](https://meta.discourse.org/t/tweets-not-showing-images/84371/12 "2018-04-02T17:37:29Z")

</div>


