# Uploading images and scrolling up jank

**URL:** https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365
**Category:** Site Feedback
**Created:** [September 26, 2021, 9:13am UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365 "2021-09-26T09:13:56Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [September 26, 2021, 9:13am UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/1 "2021-09-26T09:13:56Z")

</div>

Created a new thread not to pollute the old one with tech talk.

> [@Incredibly common products which the store clerk never heard of](https://boards.straightdope.com/t/incredibly-common-products-which-the-store-clerk-never-heard-of/951225/188):
>
> > [@Incredibly common products which the store clerk never heard of](https://boards.straightdope.com/t/incredibly-common-products-which-the-store-clerk-never-heard-of/951225/183):
> >
> > That said, I think it might be better if we could get images re-enabled here. There’s already a workaround, and not having it breaks functionality, like the ability to scroll up. Have you talked to Ed about it?
> 
> It costs money to host photos. Not going to happen.
> 
> (And i can scroll up just fine.)
> 
> One of the Discourse sites i use is funded by donations, and the owner publishes all his costs. He pays more for photo hosting than for the basic text functionality. (He also pays a little for email, so the photo hosting may not be half the total costs. I don’t remember the exact numbers.)

Huh. That’s strange. That doesn’t fit with my observations. Image uploads worked just fine when we first got here. TubaDiva then specifically disabled images. When talking to @codinghorror about this, he described it as an unsupported modification (what is commonly referred to as a “hack”). And later on, when we discussed the issue where scrolling up will often skip posts, he said it was because of the hack that disabled images also disabled caching images. And he said that Discourse depends on that feature to handle scrolling up properly.

I really don’t mind that we can’t directly upload images. The fact that it’s slightly harder adds a bit of friction, keeping people from posting too many images. But it would be nice if scrolling up wasn’t so janky, causing posts to get skipped as the images from previous posts load in. It’d be great if the mods/admin and the tech people could discuss ways to fix that.

---

<div class="post-metadata">

### Author: ![puzzlegal](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/puzzlegal/32/3827_2.png) [@puzzlegal](https://boards.straightdope.com/u/puzzlegal)
#### Post date: [September 26, 2021, 11:57am UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/2 "2021-09-26T11:57:25Z")

</div>

I’ve literally never noticed a problem scrolling up. And i do it all the time. I wonder what the issue is.

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [September 26, 2021, 10:50pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/3 "2021-09-26T22:50:09Z")

</div>

I wonder if it is browser dependent. Do you use Chrome?

I do know that, a while back, Chrome refactored scrolling a bit to try and reduce jank, and perhaps that’s playing poorly with Discourse.

On the other hand, have you scrolled up in threads that have a lot of images or videos? That’s where it becomes the most obvious. And you have to scroll up more than like 10 posts.

The reason I will do it is that I’ll get a notification about a reply to a post, then try to scroll back up to get to where I left off last time.

---

<div class="post-metadata">

### Author: ![puzzlegal](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/puzzlegal/32/3827_2.png) [@puzzlegal](https://boards.straightdope.com/u/puzzlegal)
#### Post date: [September 27, 2021, 12:47am UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/4 "2021-09-27T00:47:59Z")

</div>

I mostly use my phone. I usually use chrome or edge on my laptops, but mostly I’m on the phone.

---

<div class="post-metadata">

### Author: ![Kzbre5m](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@Kzbre5m](https://boards.straightdope.com/u/Kzbre5m)
#### Post date: [September 27, 2021, 2:48pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/5 "2021-09-27T14:48:46Z")

</div>

On my android phone (I don’t log into SDMB on my phone), and “Samsung Internet”, scrolling down towards the bottom of the thread, it sometimes get stuck at around 18 of whatever posts, and not go down any further. There’s an ad there and refuse to go any more. I can click on the 18/whatever box, use the scroll bar to jump around the blockage, but then that box disappears so I have to remember what the last post had written to get back up to it. The 18/whatever box shows up at the bottom at the “stuck” point, so I’m guessing Discourse thinks it’s at the bottom and doesn’t need to go any further downward.

Scrolling up (towards the top of the page), I sometimes get “jumps”, either down or up a couple of posts (not sure which), at the ads. This I understand to be a known issue because of reasons. (I don’t remember where I read this.)

A different Discourse website I go to doesn’t have these scrolling problems, but it doesn’t have the interwoven ads (if that’s the term?).

I hope this is the correct thread to report this.

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [September 27, 2021, 3:15pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/6 "2021-09-27T15:15:43Z")

</div>

Ah. I haven’t really encountered it much on my phone, either, to tell the truth. I think they way phone browsers implement scrolling is different.

Also it may be beneficial to make a bit of clarification since phones have entered the conversation. By scrolling up, I mean moving to the top of the page. This is different from swiping up, which moves to the bottom of the page.

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [September 27, 2021, 3:20pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/7 "2021-09-27T15:20:10Z")

</div>

> [@Kzbre5m](#):
>
> Scrolling up (towards the top of the page), I sometimes get “jumps”, either down or up a couple of posts (not sure which), at the ads. This I understand to be a known issue because of reasons. (I don’t remember where I read this.)

Yes, this is the issue I am describing. I [was told](https://boards.straightdope.com/t/issues-with-scrolling-up-and-dynamic-loading/938131) it was due to image caching being disabled on our forum. This was said to be a hack that broke a bit of Discourse functionality. puzzlegal’s post reminded me of this issue. Hence why I’m asking that image caching be reenabled.

> [@Kzbre5m](#):
>
> On my android phone (I don’t log into SDMB on my phone), and “Samsung Internet”, scrolling down towards the bottom of the thread, it sometimes get stuck at around 18 of whatever posts, and not go down any further. There’s an ad there and refuse to go any more. I can click on the 18/whatever box, use the scroll bar to jump around the blockage, but then that box disappears so I have to remember what the last post had written to get back up to it. The 18/whatever box shows up at the bottom at the “stuck” point, so I’m guessing Discourse thinks it’s at the bottom and doesn’t need to go any further downward.

This, however, is a problem being described in a different thread. Your insight about it having to do with the ads may be relevant, so I’d post about that in the other thread.

> [@Scrolling Gets Stuck](https://boards.straightdope.com/t/scrolling-gets-stuck/950784/):
>
> For the last week(ish) I’ve notice that the board gets stuck while scrolling. It doesn’t seem to matter which thread I’m in, I can scroll down to around 20 posts and then it just gets stuck. There is a kind of “window wiper” sort of thing going on for a few seconds and then the page stops trying to load and there is nothing there. I have to go to the up/down super scroll arrow box on the side to get to the posts that are supposed to be there, and it seems that they are really there, but I ju…

---

<div class="post-metadata">

### Author: ![Kzbre5m](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@Kzbre5m](https://boards.straightdope.com/u/Kzbre5m)
#### Post date: [September 27, 2021, 3:29pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/8 "2021-09-27T15:29:01Z")

</div>

> [@BigT](#):
>
> This, however, is a problem being described in a different thread. Your insight about it having to do with the ads may be relevant, so I’d post about that in the other thread.

I wasn’t sure that thread was still active. It looked like it crashed and burned, to be honest. I’ll repost over there.

---

<div class="post-metadata">

### Author: ![puzzlegal](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/puzzlegal/32/3827_2.png) [@puzzlegal](https://boards.straightdope.com/u/puzzlegal)
#### Post date: [September 27, 2021, 4:09pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/9 "2021-09-27T16:09:35Z")

</div>

> [@BigT](#):
>
> By scrolling up, I mean moving to the top of the page.

Do you mean moving to the top of the page, or moving the the direction of the top of the page? I would call both of those scrolling up, except that if I want to get to the top of a page on my phone, in discourse, I usually use the “jump to” facility.

(Also, I didn’t “bring phones into the discussion”. You neglected to clarify that the issue you describe manifests on your non-phone hardware. Most of the world mostly accesses the internet on phones, I believe. Any generic discussion of “what does it look like” ought to presume that phones are part of the conversation.)

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [September 27, 2021, 4:12pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/10 "2021-09-27T16:12:19Z")

</div>

> [@puzzlegal](#):
>
> > [@BigT](#):
> >
> > By scrolling up, I mean moving to the top of the page.
> 
> Do you mean moving to the top of the page, or moving the the direction of the top of the page?

Sorry. Yes, that word “to” should have been “toward.”

> [@Kzbre5m](#):
>
> I wasn’t sure that thread was still active. It looked like it crashed and burned, to be honest. I’ll repost over there.

I agree that it kinda died, but it’s recent enough that I think it was better to resurrect it than to make a new thread.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/codinghorror/32/4242_2.png) [@codinghorror](https://boards.straightdope.com/u/codinghorror)
#### Post date: [October 13, 2021, 9:28pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/11 "2021-10-13T21:28:57Z")

</div>

There are technically no images here but you can hotlink remote images.

The risk factor is images without dimensions, which push the layout around as they load. The browser is like “hey, look, time to load an image” and then it’s like “hey, this is a SUPER TALL image” which has to be inferred at load time since the image is not local, but remote.

Here’s a hotlinked image from imgur that I posted a while back

[![](https://i.imgur.com/8sbvSo7.png) ](https://i.imgur.com/8sbvSo7.png)

I posted 👆 by putting a link to the image on a line by itself

`https://i.imgur.com/8sbvSo7.png`

Normally Discourse would pull that image down and make a copy of it so that it isn’t lost and its disappearance doesn’t ruin the discussion years later. Why does Discourse do this? Well, imagine a “hey, look at this interesting picture of a boat” topic with 50 replies, where the image of the boat in that first post is long gone because the site hosting the image disappeared from the internet in 2015. That’s kind of a busted discussion, hence the desire to copy the image and host it locally so the discussion is still useful and interesting, a decade later.

Let’s see what that image looks like in the post.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/codinghorror/32/4242_2.png) [@codinghorror](https://boards.straightdope.com/u/codinghorror)
#### Post date: [October 13, 2021, 9:31pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/12 "2021-10-13T21:31:14Z")

</div>

Yes, that ends up as this:

```auto
<a href="https://i.imgur.com/8sbvSo7.png" target="_blank" rel="noopener nofollow ugc" class="onebox">
    <img src="https://i.imgur.com/8sbvSo7.png" width="" height="" loading="lazy">
</a>

```

Note the **lack of width and height, and the lazy loading**. So this will _definitely_ bust scrolling and push the layout around. Unfortunately, this combination of settings (no local images) is rather rare in Discourse so we haven’t tried to optimize it.

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [October 13, 2021, 10:35pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/13 "2021-10-13T22:35:01Z")

</div>

I understand the problem. We discussed it beforem My question is whether or not we can enable image caching. Would it indeed cost (a lot) more money to do that?

Ideally, Discourse would cache the image’s dimensions and have viewport-scaled placeholders (e.g. by having the scales dimensions in the img tag). Or, better yet, preload images at least partt way before the mpost itself needs to mbe displayed.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/codinghorror/32/4242_2.png) [@codinghorror](https://boards.straightdope.com/u/codinghorror)
#### Post date: [October 13, 2021, 10:39pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/14 "2021-10-13T22:39:50Z")

</div>

We are looking at this and it might be a setting that was exposed and staff turned off. We don’t think this setting (to skip image dimensions) should be user-facing so we’re going to remove the setting.

Thanks for bringing it up – definitely highlighted a deeper issue!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/codinghorror/32/4242_2.png) [@codinghorror](https://boards.straightdope.com/u/codinghorror)
#### Post date: [October 19, 2021, 8:06pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/15 "2021-10-19T20:06:19Z")

</div>

OK! We rolled out a fix for the bug and are rebaking all posts containing images. Thanks for reporting this… we do have the image dimensions, but there was an errant site setting that let admins disable image dimensions… we have removed this site setting since it’s a “shoot yourself in the foot” setting.

This rebake may take a while as it is 8,658,086 posts (ones with images), and it will happen in the background.

I’ll post an image here again, and let’s see if it gets dimensions set.

[![](https://i.imgur.com/8sbvSo7.png) ](https://i.imgur.com/8sbvSo7.png)

Good news! View source via F12 and you’ll see

`<img src="https://i.imgur.com/8sbvSo7.png" width="690" height="494" loading="lazy">`

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [October 19, 2021, 11:42pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/16 "2021-10-19T23:42:53Z")

</div>

Unfortunately, I’m in a lousy position to test right now as I’ve just upgraded my internet. Having the images load faster will also make it work better, even without this fix.

So I very much ask others who have experienced this to also check over time if scrolling up jank gets better.

Thanks, @codinghorror. This is exactly what I’ve been hoping for since the first time I reported this issue—cache the image dimensions.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/codinghorror/32/4242_2.png) [@codinghorror](https://boards.straightdope.com/u/codinghorror)
#### Post date: [October 20, 2021, 8:11pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/17 "2021-10-20T20:11:40Z")

</div>

_Most_ images without dimensions are now rebaked with dimensions. We’re still dealing with stragglers. So you should see a whole lot less of this right now – try to pay attention if you’re in a topic with a lot of pictures in it and see what happens.

But thanks all again for bringing this up and sticking with it because we drilled down to a very solid fundamental bug that fixes this problem, forever, across many instances! 🙏

---

<div class="post-metadata">

### Author: ![Senegoid](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/senegoid/32/6606_2.png) [@Senegoid](https://boards.straightdope.com/u/Senegoid)
#### Post date: [October 20, 2021, 8:31pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/18 "2021-10-20T20:31:00Z")

</div>

Many old posts (including some of mine) link to remote images that are _already_ long-gone. What becomes of those now?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/codinghorror/32/4242_2.png) [@codinghorror](https://boards.straightdope.com/u/codinghorror)
#### Post date: [October 20, 2021, 9:06pm UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/19 "2021-10-20T21:06:40Z")

</div>

If you really want to recover the lost remote image, try the wayback machine and pray. Not a lot of good options for images that go missing on defunct websites, sadly.

We do believe strongly in mirroring images in discussions for the reasons I stated above!

---

<div class="post-metadata">

### Author: ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)
#### Post date: [November 17, 2021, 6:36am UTC](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365/20 "2021-11-17T06:36:45Z")

</div>

Unfortunately, I have to report that this has not fixed the underlying problem as I had hoped. Sure, the images load better, but I still wind up with posts being skipped as I scroll up.

What seems to happen one of the posts that loads in is moved to the top of the viewport, instead of the previously loaded one that I was still on. For example, I’ll be on post 34 in a thread, with it at the top of the viewport, and reach the point where Discourse needs to load more posts. Then, as the posts load in (usually in less than a second), I’m taken instead to post 30 or 31. Sometimes this will even happen again, where I’ll not notice and keep scrolling up above post 31, and it’ll jump to post 28.

It seems to me that what should happen is that the new content loads, and then the scrolling position is sent back to the most recent post the person has read, with just enough space above it where spinning circle would have been. Thus the scroll position will not have appeared to move at all.

That said, a lot of the need to scroll up more than a couple posts would be eliminated if Discourse would show that “back” link whenever you perform actions that skip posts. These actions are (1) replying to a post before you’ve read all of them. (2) following a link from your notifications to a reply in the topic.

Basically, if there are posts between where you last left off and where you have currently started, it would be great to display the back option to take you back to where you were. Currently, it only seems to happen when you scroll up to read earlier posts or click on links that take you further up the page.

[Next page](https://boards.straightdope.com/t/uploading-images-and-scrolling-up-jank/951365.md?page=2)
