social-app: Images not being displayed properly in cards generated by a link

Steps to Reproduce

Whenever we share Godot news on Bluesky, we get no card image in the posts. This is how the same input renders in three different social networks:

Twitter

image

Mastodon

image

Bluesky

image

The url of the page being shared: https://godotengine.org/article/dev-snapshot-godot-4-4-dev-4/

The website has these two elements in the <head> pointing to the image:

<meta property="og:image" content="https://godotengine.org/storage/blog/covers/dev-snapshot-godot-4-4-dev-4.webp">
<meta name="twitter:image" content="https://godotengine.org/storage/blog/covers/dev-snapshot-godot-4-4-dev-4.webp">

Our website is statically generated, so we are not dynamically pulling this data.

What platform(s) does this occur on?

iOS, Web (Desktop), Web (Mobile)

What version of the app are you using?

Build version: 1.92.1.530; Bundle info: 89cff31b6 (prod); Bundle date: 24101917; Platform: ios

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 3
  • Comments: 19 (2 by maintainers)

Most upvoted comments

For those who find this thread - make sure your image has a Content-Type Header - that seems to be the cause.

In short:

This works - and the only difference in headers is the Content-Type: image/jpeg

https://cardyb.bsky.app/v1/image?url=https%3A%2F%2Fwww.redhillandreigatelife.co.uk%2Fresources%2Fimages%2F18770767.jpg

Original image:

HTTP/2
date: Tue, 19 Nov 2024 17:32:36 GMT
cache-control: public, max-age=31622400
vary: Accept-Encoding
x-varnish: 8492755
x-azure-ref: 20241119T173236Z-179d85bf68c7n5m9hC1FRAg6es00000005m000000001nwen
x-cache: TCP_MISS
x-fd-int-roxy-purgeid: 66710783
x-m6-cacheimages: v1

New image that works:

HTTP/2
date: Tue, 19 Nov 2024 17:33:39 GMT
content-type: image/jpeg
content-length: 125162
cache-control: public, max-age=31622400
vary: Accept-Encoding
x-varnish: 10377013 16877751
x-azure-ref: 20241119T173339Z-178d4494767lcnk8hC1FRAv94c00000004u0000000011uh9
x-cache: TCP_MISS
x-fd-int-roxy-purgeid: 66710783
x-m6-cacheimages: v1
accept-ranges: bytes

@coppolaemilio - looking at your headers for your image - you also don’t have the content-type header.

date: Tue, 19 Nov 2024 17:26:41 GMT
content-length: 239896
last-modified: Fri, 08 Nov 2024 18:52:22 GMT
etag: "3a918-6266b4052ef19"
x-frame-options: SAMEORIGIN
cache-control: max-age=14400
cf-cache-status: HIT
age: 6955
accept-ranges: bytes
report-to:...
server: cloudflare
cf-ray: 8e51e81f3a6ddbd4-FRA
alt-svc: h3=":443"; ma=86400
server-timing: ...

I think it might be something wrong with the parsing in the meta proxy. I’m debugging a similar issue on spreaker.com and images like this:

https://cardyb.bsky.app/v1/image?url=https%3A%2F%2Fd3wo5wojvuv7l.cloudfront.net%2Ft_facebook_share%2Fimages.spreaker.com%2Foriginal%2F09d1383413af17b092ceffd8655925a0.jpg

are not being fetched while this:

https://cardyb.bsky.app/v1/image?url=https%3A%2F%2Fd2nsw11i8ho592.cloudfront.net%2Fbuild%2Fassets%2Fog-image-20b2699d.jpg

is working correctly. Since pretty much is the same fro the two images:

  • Both served from cloudfront + S3
  • Bot with correct mime type in the header

it looks like the issue might be in the presence of . in the image path in the first one (images.spreaker.com).

We tried to look into the cardyb.bsky.app source but i’m not sure were too look, any guidance here i appreciated.

@TimJoy-NQDM that fixed the issue! I still think Bluesky should fix it on their end, so I’ll leave the issue open.

There appears to be a behaviour where once a card has been attempted from a domain that fails, further attempts at loading a card bypass the image request completely, which makes repeated testing difficult.

We could do with something like Meta’s sharing debugger - using it forces it to scrape and cache changes & updated images.

Adding a +1 to this issue. Does anyone know how to make sure the content-type header gets set for OG images automatically generated with NextJS?