Running Discourse 3.1.0.beta3 (
We’re seeing some very odd behaviour with Onebox and PNG / JPG images.
Here’s an image that I’d like to onebox:
It should embed nicely like so:
But instead the image just displays as a link in the post.
Browser console is showing a 404:
Some other examples:
Hmm, it works here.
Actually, I don’t think it does, the large image hasn’t appeared?
I first thought this bug might be due to the file size, our members often post 40MB+ images but I can replicate this issue on
try.discourse.org using just a 5MB png image.
The image appears in the composer window when composing my post but does not appear in the post itself when submitted.
It also appears in the composer window if I then edit the post:
Here’s a onebox url image to try:
And to test it here on meta, it should appear here:
This bug is present on
try and on
The image did appear briefly when I submitted that post but then it disappeared again a few seconds later, I should have done a screen recording. Is it being lost/broken in the baking process?
I’ve been poking this bug a bit more.
If I look at a post where the image has failed to be one boxed / pulled down a local copy, when I Edit the post I see this 404 Not Found error in the browser console:
The URL it’s trying to fetch is:
Unsure why it’s throwing a 404, when the image does exist
This has worked fine for the last five years, it’s only broken in the last three or four weeks.
I’ve been having another run at it today, but I’m afraid I am no closer to working out what’s happening.
When I try and add the
https://dronescene.co.uk/images/uploads/fullsize/20211216142548_DJI_0205_HDR_Pano.png it shows in the preview, and in the post for a second, and then is just blank.
I don’t see any 404s. I did think it was down to the size, as it was loading line by line in the preview like it was the 90s
But you said you tried with a smaller one and got the same. Which one was that, and I’ll try that one too.
Which as you say, it does for a second, then it vanishes again.
Yet it’s visible in the composer if I edit the post
I believe it’s removed because the file is too large. By default, the
max image size kb is 4096kb, and this specific file is > 5000 kb.
From my understanding, if you upload an image, it’s automatically resized/compressed before sending. You can upload large photos because of the
client-side browser optimization.
download remote images to local setting, Discourse will try to download the image as it is, and if it’s too large, it will be removed from post content.
Has this default value been changed in the last couple of months?
We have over 1,000 images that are 30-40mb, or higher, which have been pulled remotely for many many years without an issue
@Arkshine I’ve looked in to this again this morning as I may have misunderstood your message earlier.
We changed our setting a number of years ago to allow images of up to 100MB in size.
I’ve been trying to trace exactly when this broke and I can narrow it down to roughly some point after 3rd March 2023.
Here’s a 35MB image that was working on 3rd March 2023:
And a 27.3MB example from the same date in March:
And a 11mb example from 27th February:
I might have a wade through the commits made in the last six weeks or so and see if any of the commit messages jump out at me
The raw content for this specific post (and the one below) on your forum shows that it is an uploaded image, not an external link. Because of
Client side image optimization enabled by default, you will be able to upload large images.
Your initial issue is about inserting an external image link.
That said, I’m unsure if Discourse behavior is expected not checking the image size when pasting an image link.
Can you share the value of
upload_size in your
I don’t know about Discourse being able to download very large remote images.
However, I remember that previously, when you hotlinked a large image, it displayed a message like “This image is too large to be displayed in the forum”, with a link to the external picture.
It seems it doesn’t happen anymore.
Pasting an external, large image link (
https://upload.wikimedia.org/wikipedia/commons/0/0b/New_cyclic_large.gif - 11 MB GIF) , I can repro your issue:
It looks very much like a bug and possibly a regression.
I think you may have misunderstood the issue, or maybe you are seeing the cause of the bug
I did not upload that image to Discourse, I just pasted a link, exactly like
@Canapin 's screen recording below
It’s been pulling large images for years now
@Canapin mate, many years, it’s only stopped working in the last six or eight weeks.
Coin-coin le Canapin:
I can repro your issue:
Thanks for testing
I can replicate it on our forum, on
try.discourse.org and on meta.discourse.org
I’ve placed a bounty on the issue:
What would you like done?
I’m placing a bounty on this bug in the hopes that someone can fix it:
Onebox image issues
When do you need it done?
Pull Request made by 30 April 2023
What is your budget, in $ USD that you can offer for this task?
Thanks again to everyone who has looked at this issue so far
i was able to reproduce this issue as well. i also went through all my image related settings to make sure nothing there was somehow causing the effect. i notice when i first make the post with large image link, it flashes for a minute like it’s going to load from the top of the photo, then just disappears (this despite the image being very visible in the post preview window).
@Lilly that’s exactly the issue we’re seeing too.
i just tested in private messages and the image shows up fine as expected and links to the original. so the issue is strictly in topic posting views it appears.
@Richie cool photos btw
FWIW I’ve just given that a test, but mine disappeared in the PM as well.
here is my pm view:
getting same issue in desktop and mobile views too.