forem / forem

For empowering community 🌱
https://forem.com
GNU Affero General Public License v3.0
21.99k stars 4.05k forks source link

Twitter Card Images for Articles Are Occasionally Positioned Inconsistently #3802

Open jessleenyc opened 5 years ago

jessleenyc commented 5 years ago

Describe the bug Sometimes, twitter card images aren't centered properly when the social card unfurls. This is likely happening on Twitter's end but we can also fix this if we crop the images ourselves through cloudinary.

michael-tharrington commented 5 years ago

I spoke with @healeycodes who said it was cool to share a bit of info here...

Steps to reproduce the behavior

  1. Copy this URL: https://dev.to/healeycodes/solving-puzzles-with-high-performance-javascript-3o4k
  2. Go here: https://cards-dev.twitter.com/validator
  3. Run the URL in the card reader to see that it's left-aligned.

Expected behavior Article cover images should always appear centered when being transformed into social card images.

Screenshots

Here's a picture of the left-aligned social image:

https://cl.ly/c2ff13627cf9/download/Image%202019-05-23%20at%2012.45.55%20PM.png

Here's another picture of a separate post by the same author with a similar cover image which centered correctly:

https://cl.ly/6bcbfb147f55/download/Image%202019-05-23%20at%2012.47.51%20PM.png

This post was originally left-aligned too - https://dev.to/healeycodes/my-experience-with-pair-programming-4c0a but I used a manual override to fix it.

Note: I don't think it necessarily only happens to this author; but, these are known examples. If I see it happen to another author, I'll report back.

michael-tharrington commented 5 years ago

Just found another example of this here:

https://cl.ly/faff3a2d7a71/Image%202019-09-20%20at%2011.50.56%20AM.png

henrikwirth commented 4 years ago

image

Have the same happening to my articles. They are aligned to right side instead of center.

I guess there are two options to that:

The second one would probably much easier to implement.

brentonhouse commented 4 years ago

Another (possibly easier) option is to allow user to upload twitter card image. The aspect ratio that you use for headers on dev.to is different than most of the social media images to that is why it is appearing odd.

maud-lv commented 4 years ago

Hello! This also affects my posts. Here an example on Twitter image

And on LinkedIn: image I second what brentonhouse said: uploading social media cards in our dev.to publications would probably solve this.

kay-is commented 4 years ago

Seems like all the social media platforms (Twitter, Facebook, LinkedIn) use 19:10 only dev.to uses 12:5

So maybe dev.to should allow 19:10 for future posts?

justin-schroeder commented 4 years ago

Having the same issue on one of my recent posts.

Screen Shot 2020-06-18 at 4 13 49 PM

Personally I would love to see support for additional meta tags in the front matter. That way you could actually have a different cover image and social image. Would be nice to see support for:

og:image twitter:image twitter:card (defaults to summary_large_image, but would be nice to specify)

viclafouch commented 4 years ago

Having the same issue on my post published today (https://dev.to/viclafouch/build-a-complete-modal-component-with-react-hooks-2fk8)

Preview on Linkedin

image

kay-is commented 4 years ago

Update: I found a social media manager (e-clincher) that allows me to extract images from a post, stuff I post with that manager doesn't fit 100% either, but at least its centered now.

AdrianSandu commented 4 years ago

I can also confirm the issue happening on Discord, Slack, and LinkedIn preview. For Twitter, I am usually creating my own separate image to avoid the issue.

For example, this is how my latest post on DEV renders in these three places:

Discord preview

image

Slack preview

image

LinkedIn preview

image

kay-is commented 4 years ago

Anything we can do here? This is rather irritating.

cmgorton commented 3 years ago

@jessleenyc any thoughts on this feature request? Do you think this should be labelled as a potential RFC?

cmgorton commented 3 years ago

Forem team needs to investigate:

cmgorton commented 3 years ago

Since this issue has gone stale I am going to close it. If anyone would like to still implement this feature let me know and we can turn this issue into a discussion

michael-tharrington commented 9 months ago

I wanted to reopen this one as it's something I hear occasionally reported.