Twitter: black rectangle, or cropping of different types of inverted logo, in some tweets that refer to pages in the domain

(Graham Perrin) #1

An example:

Not yet reproducible with any other instance of Discourse (I experimented with tweets for four other instances).

@staff please, maybe check both:

  1. your site assets topic
  2. URLs for logos

– do the URLs refer to the assets? Is each asset in a required format? And so on.


If it helps: I do not recall seeing the black lumps around 2017-04-13. So maybe the issue arose from an admin preference that was set some time after that date.

(Jdittrich) #2

I’ll put that on a github issue. Sadly there is no specific repo or so, but I assume It makes sense to have it as a task there:

(Graham Perrin) #3

@staff please double-check that admin settings do not inappropriately refer to items in the domain.

From Assets for the site design:

4. … get the path to the uploaded images …
5. Paste those image paths into basic settings …

Some of what’s under makes me suspect that some admin settings are not yet making proper use of assets in Assets for the site design.


(Graham Perrin) #4



A sign of possible experimentation with a different logo (opensourcedesign-logo-inverted.png) but again, it’s not in an expected domain:


From a copy of the log (before I retired):

– again, there’s the domain. From what I recall of site administration (I learnt some time around 2017-04-11), that’s not a proper approach.

Instead: need to make proper use of – and refer to assets within – Assets for the site design.

(Jdittrich) #5

OK, I fixed that now.

I must say, that whole post-to-thread, copy URL approach is a bit counterintuitive…

(Graham Perrin) #6

Thanks :thumbsup: I see some improvement already.

Has default_opengraph_image_url received attention?

(Graham Perrin) #7

We have for a topic that is linked from a tweet that was very recently sent by @pdurbin

@discourse please: might it help to use a smaller logo? Or is the problem more likely a rogue admin setting reference to the image in the domain?

(Jdittrich) #8

As far as I am concerned, I replaced the logo for twitter with the proper (aka discourse-uploaded) link to the image.

(Discourse Support) #9

I checked the tweet and I think there’s a problem with that specific image:

If you examine Twitter source for that image

<img class="u-block" data-src=";name=600x314" alt="Photo published for InVision (" src=";name=600x314 ">

The actual image is a black rectangle:

(Graham Perrin) #10

Thanks @discourse the topic that’s referred from does have a YouTube video in the opening post, and I do recall reading of a case (not this forum) where the presence of a video in a Discourse topic caused a problem in a tweet, but I don’t think that’s the problem here. from two weeks ago refers to something other than an opening post by @pdurbin and this tweet appears OK, Twitter presents Philip’s avatar on Discourse.

Results of a few more test tweets a few minutes ago:

The likelihood of a black rectangle appearing when a tweet refers to a topic (not to a numbered post) in this forum suggests to me that there remains an issue, or combination of issues, with local admin settings.

In the related GitHub issue it was observed that something was extraordinarily large. Whilst that one thing may be no longer an issue, the first of the five screenshots above does suggest that a more appropriately sized image (not necessarily a logo, not necessarily square) should be applicable somewhere in the admin settings.


Maybe useful

Cards Markup Tag Reference — Twitter Developers

Summary Card with Large Image — Twitter Developers



The Definitive Guide to Twitter Cards | AdParlor

Side note

@jdittrich sorry for returning to this topic (after the detour to GirHub) but my gut told/tells me that some Discourse staff expertise may be required and it’s easier to address @discourse from here.

(Graham Perrin) #11

@staff if you like, experiment with the first of those two URLs for one or both of the following:

  • default_opengraph_image_url
  • twitter_summary_large_image_url

Origin imported to GIMP:

  1. 300 x 70 at 72 pixels/inch, canvas heightened to 157
  2. 673 x 157 at 72 ppi.

If the second image (673 x 157) is used, I suspect that the ratio will cause a Twitter representation to be cropped.


Twitter-specified minimum dimensions of 300x157 for twitter:image

(Discourse Support) #12

Not sure; apparently twitter doesn’t like this PNG. If you view source on
the target page, in the markup you will see:

<meta name="twitter:image" content="" />

Opening the image

It is a 512x512 PNG with alpha transparency. It could be the size, or it
could be the alpha transparency that Twitter doesn’t like.

(Graham Perrin) #13

Thanks again.

Also remarkable: the first of yesterday’s five shots appears to be a cropped representation of an inverted logo; and earlier (2017-05-27),

Another cropped appearance of the inverted logo:

(Discourse Support) #14

At any rate, one way to deal with this is to put an image in the first post
that you want to be used when people link to the topic. This also applies
to individual posts if someone deep links to an individual post, the first
image in the post is used.

(Graham Perrin) #15

I don’t disagree but still, my gut tells me that there might be an issue with an admin setting referring to something in the domain.

With non-extended Firefox 53.0.2:

@staff, please consider the mixture of:

  • secure content (this forum)
  • insecure content, the logo from

Sure, but let’s aim to resolve the underlying issue(s).

(Jan-Christoph Borchardt) #16

I changed the Twitter summary large image to – should look better now as a quick fix.

(Graham Perrin) #17

Please, is there a reason for not following Discourse’s standard instructions in Assets for the site design?

Nope, not yet, it’s still black rectangles galore.


(Graham Perrin) #18

@staff please try the first of the URLs suggested at Twitter: black rectangle, or cropping of different types of inverted logo, in some tweets that refer to pages in the domain above.

Amongst the test results:

(Jdittrich) #19

I changed the twitter and the opengraph images to using the URL I copied from the images which I uploaded in the assets thread. If I got it right, this was the recommended way of doing it (? @grahamperrin)

(Graham Perrin) #20

Thanks, that sounds right but most of the previously affected tweets remain affected by blank rectangles.

Also now in some tweets we get a cropped version of a different oversized image:

Can you tell where, in admin settings, is specified?

That’s in the domain.

Filtering or browsing the log may prove useful.

Today’s inverted logo (below) from a GitHub domain appears different from a previous inverted logo.