Oneboxing uses full size thumbnail images

For example: This topic has a oneboxed link with a 1408x528 pixel 640kb image, which is way more than is needed for the 129x48 pixel thumbnail that is shown, even accounting for a 2X or 3X pixel density.

Can oneboxing process the image to shrink it to a more reasonable size? The image is stored locally, so it should be possible.

1 Like

Based on those dimensions and file size it sounds like it should be a jpg from the source, but is instead a png?

1 Like

But what if you prefer a differently formatted one-box with a larger image? I could see that happening at some point.

Also, I would be a bit nervous about a change in behaviour here … the popular Topic List Previews plugin uses these images to create large previews on the Topic List (just as Facebook (and Fakebook!) does). They would look pretty awful at significantly lower resolution. We’d at least need a way to recall the original, generously proportioned, open graph image url on a rebake.

(btw, as aside checkout my How To which is rather pertinent given the Forum you link:

Turning a topic into interactive fiction ;))

Looking more closely, this is an animated GIF so that is kinda expected here. I don’t think your request makes a lot of sense without the additional context. This isn’t just an “image”, it’s a small movie.

The format of the image doesn’t matter, this is just the first example I found. Here’s an example with a JPG: it has a 744kb 1080p image which it shows in a 60x60px thumbnail.

What I expected is that it gets resized, like an attachment would be, perhaps to a height of 180px (for 3X pixel density displays). When I do that manually it drops to 31kb, 4% of the original file size!

@merefield raises an interesting point about Topic List Previews and Fakebook. Still, I think the default behaviour should be to resize them.

Something is wrong with their twitter integration. See how it looks here

Huh. Well we haven’t changed any settings to do with Twitter or oneboxing. No non-standard plugins or theme components aside from copy-to-clipboard.

Let me try another post:

Okay, that still embeds a 720p image.

I am guessing you didn’t set up Twitter API for twitter login? That’s required to get proper Twitter oneboxing in my experience, even if you don’t plan to let users use their Twitter accounts to log in, although that is a nice benefit.

It really doesn’t matter if the image is 500k in today’s world, to be honest. And with retina devices being so common, you want a 2x sized image anyhow in most cases.

1 Like

Yeah, no Twitter API. I’ll consider it, thanks!

And I guess you’re right. Though I bet sooner or later it will be shoving a multi-mb 4K image into a tiny 60px thumbnail :wink:


Right but this is a bit of a micro-optimization at the current time. And honestly if the source is doing something inappropriate, the source should fix itself for the betterment of the whole web.


Right, Discourse doesn’t guess which image to use, it takes what the og:image meta property says to use. So it is up to the source to be telling us to onebox a sensible image. Okay, thanks for helping me understand more.