# Oneboxing van grote afbeeldingen mislukt zonder visuele aanwijzing

**URL:** https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377
**Category:** Bug
**Tags:** onebox
**Created:** [25 maart 2023 om 09:25 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377 "2023-03-25T09:25:48Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [25 maart 2023 om 09:25 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/1 "2023-03-25T09:25:48Z")

</div>

Running Discourse 3.1.0.beta3 ([7c6a8f1c74](https://github.com/discourse/discourse/commits/7c6a8f1c74ea7ea3e81d9ffa80ca2227ee36a006))

We’re seeing some very odd behaviour with Onebox and PNG / JPG images.

Here’s an image that I’d like to onebox: `https://dronescene.co.uk/images/uploads/fullsize/20211216142548_DJI_0205_HDR_Pano.png`

It should embed nicely like so:

[https://dronescene.co.uk/images/uploads/fullsize/20211216142548\_DJI\_0205\_HDR\_Pano.png(image larger than 10 MB)](https://dronescene.co.uk/images/uploads/fullsize/20211216142548_DJI_0205_HDR_Pano.png)

But instead the image just displays as a link in the post.

Browser console is showing a 404:

 ![Screenshot 2023-03-25 at 09.15.34](https://global.discourse-cdn.com/meta/original/4X/1/b/9/1b9f0fa10eaa7fe3014ff615483d992878fc71d3.png)

Some other examples:

Small PNG:

`https://dronescene.co.uk/images/uploads/fullsize/20211106095005_vlcsnap_2021_05_04_17h10m24s149.png`

 ![](https://global.discourse-cdn.com/meta/original/4X/b/0/d/b0dfe59506755eebbdc238875b8e73883ede595a.jpeg)  
Large JPG:

`https://dronescene.co.uk/images/uploads/fullsize/20230227161106_DJI_0087_1.jpg`

[https://dronescene.co.uk/images/uploads/fullsize/20230227161106\_DJI\_0087\_1.jpg(image larger than 10 MB)](https://dronescene.co.uk/images/uploads/fullsize/20230227161106_DJI_0087_1.jpg)

Large PNG:

`https://dronescene.co.uk/images/uploads/fullsize/20220103215207_IMG_5782.png`

[https://dronescene.co.uk/images/uploads/fullsize/20220103215207\_IMG\_5782.png(image larger than 10 MB)](https://dronescene.co.uk/images/uploads/fullsize/20220103215207_IMG_5782.png)

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [25 maart 2023 om 09:27 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/2 "2023-03-25T09:27:38Z")

</div>

Hmm, it works here.

But it fails on [try.discourse.org](http://try.discourse.org)

[https://try.discourse.org/t/lorem-lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit/1425/2](https://try.discourse.org/t/lorem-lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit/1425/2)

 ![Screenshot 2023-03-25 at 09.27.08](https://global.discourse-cdn.com/meta/original/4X/3/0/9/3099de2d46140aa742ef9d5c9ca4765a71970fec.jpeg)

 ![Screenshot 2023-03-25 at 09.26.55](https://global.discourse-cdn.com/meta/original/4X/3/e/5/3e5531459a21b30eaf4089c16cee3da53c74d064.jpeg)

See how the large one isn’t displaying?

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [25 maart 2023 om 09:32 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/3 "2023-03-25T09:32:23Z")

</div>

> [@Richie](#):
>
> Hmm, it works here.

Actually, I don’t think it does, the large image hasn’t appeared? 🤔

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [31 maart 2023 om 07:36 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/4 "2023-03-31T07:36:39Z")

</div>

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](http://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.

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/e/7/4e724a657ee308889b68313247e451174b048d06.png)

It also appears in the composer window if I then edit the post:

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/a/1/ba1943a5feb0eb928789c69e3c9c6100f940ad8f.jpeg)

Here’s a onebox url image to try:

[https://dronescene.co.uk/images/uploads/fullsize/20230329003455\_Screenshot\_2023\_03\_29\_at\_00.23.31.png](https://dronescene.co.uk/images/uploads/fullsize/20230329003455_Screenshot_2023_03_29_at_00.23.31.png)

And to test it here on meta, it should appear here:

[https://dronescene.co.uk/images/uploads/fullsize/20230329003455\_Screenshot\_2023\_03\_29\_at\_00.23.31.png(image larger than 10 MB)](https://dronescene.co.uk/images/uploads/fullsize/20230329003455_Screenshot_2023_03_29_at_00.23.31.png)

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [31 maart 2023 om 07:38 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/5 "2023-03-31T07:38:06Z")

</div>

> [@Richie](#):
>
> And to test it here on meta, it should appear here:

This bug is present on `try` and on `meta`.

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? 🤔

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [11 april 2023 om 15:55 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/11 "2023-04-11T15:55:41Z")

</div>

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:

 ![Screenshot 2023-04-11 at 16.52.56](https://global.discourse-cdn.com/meta/original/4X/a/9/9/a99296ad434f8b12f4187eafb582e7cf57fc8064.jpeg)

The URL it’s trying to fetch is:

`https://greyarro.ws/onebox?url=https%3A%2F%2Fdronescene.co.uk%2Fimages%2Fuploads%2Ffullsize%2F20230411071449_8719D92D_726A_46BF_9437_A06DD0507D77.jpeg&refresh=true&category_id=17&topic_id=61425`

Unsure why it’s throwing a 404, when the image does exist 🤔

[https://dronescene.co.uk/images/uploads/fullsize/20230411071449\_8719D92D\_726A\_46BF\_9437\_A06DD0507D77.jpeg](https://dronescene.co.uk/images/uploads/fullsize/20230411071449_8719D92D_726A_46BF_9437_A06DD0507D77.jpeg)

[https://dronescene.co.uk/images/uploads/fullsize/20230411071449\_8719D92D\_726A\_46BF\_9437\_A06DD0507D77.jpeg(image larger than 10 MB)](https://dronescene.co.uk/images/uploads/fullsize/20230411071449_8719D92D_726A_46BF_9437_A06DD0507D77.jpeg)

This has worked fine for the last five years, it’s only broken in the last three or four weeks.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [11 april 2023 om 16:01 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/12 "2023-04-11T16:01:39Z")

</div>

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. 👍

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [11 april 2023 om 16:03 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/13 "2023-04-11T16:03:07Z")

</div>

Thanks @JammyDodger

Here’s just a small 5mb image that has the same problem: [https://dronescene.co.uk/images/uploads/fullsize/20230329003455\_Screenshot\_2023\_03\_29\_at\_00.23.31.png](https://dronescene.co.uk/images/uploads/fullsize/20230329003455_Screenshot_2023_03_29_at_00.23.31.png)

And it should appear here:

[https://dronescene.co.uk/images/uploads/fullsize/20230329003455\_Screenshot\_2023\_03\_29\_at\_00.23.31.png(image larger than 10 MB)](https://dronescene.co.uk/images/uploads/fullsize/20230329003455_Screenshot_2023_03_29_at_00.23.31.png)

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [11 april 2023 om 16:03 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/14 "2023-04-11T16:03:41Z")

</div>

> [@Richie](#):
>
> And it should appear here:

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 🤔🤯

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [13 april 2023 om 22:59 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/15 "2023-04-13T22:59:18Z")

</div>

> [@Richie](#):
>
> Here’s just a small 5mb image that has the same problem:

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.

> <https://github.com/discourse/discourse/blob/main/lib/cooked_post_processor.rb#L395-L400>

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](https://meta.discourse.org/t/client-side-image-optimization-enabled-by-default/197617).

With `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.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [14 april 2023 om 05:24 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/16 "2023-04-14T05:24:58Z")

</div>

Hi @Arkshine

> [@Arkshine](#):
>
> By default, the `max image size kb` is 4096kb

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 🤔

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [14 april 2023 om 07:12 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/17 "2023-04-14T07:12:33Z")

</div>

Sorry @Arkshine I’ve looked in to this again this morning as I may have misunderstood your message earlier.

> [@Arkshine](#):
>
> By default, the `max image size kb` is 4096kb, and this specific file is \> 5000 kb.

We changed our setting a number of years ago to allow images of up to 100MB in size.

 ![Screenshot 2023-04-14 at 08.07.17](https://global.discourse-cdn.com/meta/original/4X/f/5/4/f5417ecaa53f433c5ac44899b40f7a47fe27e39f.png)

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:

`https://dronescene.co.uk/images/uploads/fullsize/20230303120013_DJI_0013.jpg`

 ![Screenshot 2023-04-14 at 07.46.36](https://global.discourse-cdn.com/meta/original/4X/7/6/f/76fb0b98c1d26f583fe8c3f952337975d5d15896.jpeg)

And a 27.3MB example from the same date in March:

`https://dronescene.co.uk/images/uploads/fullsize/20230303120713_DJI_0055.jpg`

 ![Screenshot 2023-04-14 at 07.52.05](https://global.discourse-cdn.com/meta/original/4X/6/0/0/6009fe9a96e1628d706bb80de021e307b57ddc9d.jpeg)

And a 11mb example from 27th February:

 ![Screenshot 2023-04-14 at 07.54.16](https://global.discourse-cdn.com/meta/original/4X/6/e/d/6ed4254ae1821dfe867f69a37e4c9271c2662662.jpeg)

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 🙂

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [14 april 2023 om 13:04 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/18 "2023-04-14T13:04:23Z")

</div>

> [@Richie](#):
>
> Here’s a 35MB image that was working on 3rd March 2023:
> 
> `https://dronescene.co.uk/images/uploads/fullsize/20230303120013_DJI_0013.jpg`

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](https://meta.discourse.org/t/client-side-image-optimization-enabled-by-default/197617), 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. 🤔

> [@Richie](#):
>
> We changed our setting a number of years ago to allow images of up to 100MB in size.

Can you share the value of `upload_size` in your `app.yml`?

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [14 april 2023 om 13:06 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/19 "2023-04-14T13:06:27Z")

</div>

Hey Richie!

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](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.

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [14 april 2023 om 13:49 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/20 "2023-04-14T13:49:15Z")

</div>

> [@Arkshine](#):
>
> 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

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 😊

> [@Canapin](#):
>
> I don’t know about Discourse being able to download very large remote images.

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.

> [@Canapin](#):
>
> I can repro your issue:

Thanks for testing 👍

I can replicate it on our forum, on [try.discourse.org](http://try.discourse.org) and on [meta.discourse.org](http://meta.discourse.org)

> [@Canapin](#):
>
> It looks very much like a bug and possibly a regression.

I’ve placed a bounty on the issue:

> [@\[PAID\] Bug fix re oneboxing / local fetching of images](https://meta.discourse.org/t/paid-bug-fix-re-oneboxing-local-fetching-of-images/261638):
>
> What would you like done? I’m placing a bounty on this bug in the hopes that someone can fix it: [Oneboxing large images fails with no visual cue](https://meta.discourse.org/t/onebox-image-issues/259377) 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? USD$250

Thanks again to everyone who has looked at this issue so far 🙇‍♂️

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 april 2023 om 14:20 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/22 "2023-04-14T14:20:49Z")

</div>

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).

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [14 april 2023 om 14:21 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/23 "2023-04-14T14:21:46Z")

</div>

Thanks @Lilly that’s exactly the issue we’re seeing too.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 april 2023 om 14:24 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/24 "2023-04-14T14:24:24Z")

</div>

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 🙂

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [14 april 2023 om 14:31 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/25 "2023-04-14T14:31:22Z")

</div>

FWIW I’ve just given that a test, but mine disappeared in the PM as well.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 april 2023 om 14:35 UTC](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377/26 "2023-04-14T14:35:59Z")

</div>

weird

here is my pm view:

 ![IMG_3186](https://global.discourse-cdn.com/meta/original/4X/5/7/6/57615227a518507a215370a7eb8bee39f1b2c711.jpeg)

getting same issue in desktop and mobile views too.

[Next page](https://meta.discourse.org/t/oneboxing-large-images-fails-with-no-visual-cue/259377.md?page=2)
