-21

TLDR

Images uploaded to SO should be uploaded at 72 dpi. If they are not, this should be fixed to avoid the "huge image" problem which plagues the site.


One of thousands of examples of an absurdly large image (now deleted).

An example of one I fixed by hand edit (look at the before/after edit versions).

14
  • 6
    Millions, really? I'm sure there are quite a few but let's not blow things out of proportions, it damages the credibility of the request. I wonder if this is not more a CSS issue, images should respect a maximum width.
    – Gimby
    Commented Feb 16, 2023 at 13:44
  • 12
    Nearly all of these images probably shouldn't be uploaded in the first place. Commented Feb 16, 2023 at 14:08
  • 1
    @KarlKnechtel I'm sure you're right but when you have one problem you tend to have two problems. A CSS bug fix would probably happen a lot sooner than any kind of image upload restriction.
    – Gimby
    Commented Feb 16, 2023 at 14:20
  • 5
    @Gimby I don't think there's a CSS issue? The image respected the max width of 659px, the maximum post width.
    – Andrew T.
    Commented Feb 16, 2023 at 14:22
  • 1
    Also, note that I have resized the image in question. Refer to the revision history to observe the original behavior (apparently it is bigger in the revision history because the max width is set to 1051px there).
    – Andrew T.
    Commented Feb 16, 2023 at 14:26
  • @Gimby it's an excellent point that the issue could be fixxed "in browser"...
    – Fattie
    Commented Feb 16, 2023 at 16:03
  • 6
    Separately, as others have hinted, there’s so much hyperbole in your questions that it’s hard to take them seriously. “Millions”, “plagues”, “absurdly” - these words do nothing but make people roll their eyes
    – Clive
    Commented Feb 16, 2023 at 19:35
  • 1
    It's a little strange to me that we still use this "72dpi" terminology when real-world screens have actual pixel-per-inch counts that are all over the place and generally a fair bit higher than 72. (For that matter: I can remember people using this terminology all the way back to first-generation "luggable" Macs, and I'm pretty sure their displays were less than 72dpi.) My current display is at about 130 dpi by my calculations and I imagine most people would consider it nearly a piece of junk by now. Commented Feb 16, 2023 at 20:01
  • @KarlKnechtel such churlishness (your first comment) achieves nothing. If you're in the camp "images are bad" surely you don't additionally want them to furthermore be replicated, ridiculously, at twice the correct size ?
    – Fattie
    Commented Feb 16, 2023 at 20:40
  • @KarlKnechtel regarding your latter comment. That's just general social chat? Unrelated this QA ?
    – Fattie
    Commented Feb 16, 2023 at 20:42
  • 3
    "If you're in the camp "images are bad" surely you don't additionally want them to furthermore be replicated, ridiculously, at twice the correct size ?" I want them to be edited out, which makes the point moot. Such editing is easy to do, we just need more 2000+ rep users to care. Commented Feb 17, 2023 at 0:01
  • @AndrewT. "I don't think there's a CSS issue" - well you're not wrong, It did not break the page layout. But the image is not scaled down, it is just partially visible instead.
    – Gimby
    Commented Feb 17, 2023 at 13:29
  • Hi Karl, it seems that you're in the camp "you don't want images on SO". It's tough having a minority opinion, particularly if you're an extremely small (yet passionate) minority. {To make an example. I believe all questions on SO more than 5 years old should simply be deleted. To me this is an exceedingly obvious business move for Prosus (and much better for us users) since it would eliminate at a stroke the absurd problem on SO where answers go incredibly wrong and out of date over time. However ... it's not going to happen. I'm in a small yet passionate minority} Similarly,
    – Fattie
    Commented Feb 19, 2023 at 16:42
  • if you had 100 of your "2000+ users", only 1-2 of them, like you, would be in the anit-image camp. nobody wants to delete these stackoverflow.com/questions/746670/… images. Even worse, I feel for you, as they will add video soon. It's absurd it is the 21st century and one can't use video on SO, people resort to hokey animated gifs etc.
    – Fattie
    Commented Feb 19, 2023 at 16:43

2 Answers 2

14

The actual issue here is not that people can upload high-DPI images. That's mostly good: automatically resizing images could lose relevant detail, for instance.

The actual issue is that posts display absurdly tall images at full height. Capping the displayed height of images (while still allowing users to click through to the full-resolution source) would prevent them from dominating the space on the page without sacrificing available information in the image.

13
  • 1
    hi Ryan, (1) regarding the "absurdly tall height". Couldn't agree more. BUT. Your first paragraph. The simple, straightforward issue is that: On a Mac, you double click [by default that will use "Preview.app" on the mac] to open an image (say, a screenshot you have taken) and it will show it "two inches across". Because in Apple's Preview.app, Apple compensated for the fact that, their screenshot mechanism behaves in an "unhelpful, for the broader internet" manner. You then post the screenshot to SO. understand that in 100.0% of cases, the user in question would look at the SO image...
    – Fattie
    Commented Feb 16, 2023 at 19:41
  • ... and state "Oh, something's broken. That image is twice as large as I want it to be." It's just that simple. the chain "mac - screenshot - post to SO" undeniably and absolutely results in screenshots 2x as big as they should be. Note that a HANDFUL of exceptionally careful people (say, me) bother to "change to 72, then, 50% size" images before I upload them to SO. But other than for those handful of "hand-fixed" images they are, simply and literally shown at the wrong size on SO. There is chatter above about hyperbole but this is such a simple issue to understand, there is frustration
    – Fattie
    Commented Feb 16, 2023 at 19:44
  • Again, Ryan, i hope those two long comments explain it - as it is a very simple issue. The "millions" of images, from Mac, on SO are - very simply - being shown "wrong", ie at twice the size the posting OP wanted them to appear it.
    – Fattie
    Commented Feb 16, 2023 at 19:45
  • Ryan, just returning to your first paragraph for a sec. the notion that "in some cases, images need to have a huge number of pixels" [and indeed, a certain format, say png not jpg, whatever] - in relation to a filmmaking forum, color theory discussion, moire theory or whatever. That honestly just has no connection at all to images posted on SO. (Sure, other than an obscure handful of examples of non-programming stuff.)
    – Fattie
    Commented Feb 16, 2023 at 19:50
  • 1
    @Fattie "...that in 100.0% of cases..." That's very exaggerated. In many cases one will never notice a difference because the image is wider than the question width and will automatically be scaled down to the question width - no matter what's the resolution of the image. Commented Feb 16, 2023 at 20:35
  • @samcarter_is_at_topanswers.xyz ? say the image is meant to be 1 inch across. on SO, it will appear 2 inches across. (still well within the "emergency question width", and still looking ridiculous because it's 2x as big as i should be)
    – Fattie
    Commented Feb 16, 2023 at 20:39
  • 1
    @Fattie Many images aren't meant to be smaller than the question width. Most screens are in landscape, so screenshots will often be in landscape as well and likely wider than a question. You are vastly exaggerating the situation. Commented Feb 16, 2023 at 20:43
  • I'm sorry, that's simply wrong @samcarter_is_at_topanswers.xyz . yes, sometimes people post "full screen of my Mac" or "full screen of my phone" (which is absolutely enormous these days), rather, when discussing a button on Android or iPhone or whatever it may be, you post a screen shot of the button, animation, dial or whatever in question.
    – Fattie
    Commented Feb 16, 2023 at 20:47
  • Also - why wouldn't one want SO to simply ......... fix the problem? "JDB" below has given a trivial fix, indeed two excellent, very trivial fixes, that Prosus could implement.
    – Fattie
    Commented Feb 16, 2023 at 20:48
  • @samcarter_is_at_topanswers.xyz , if you look at any of my QA on the site, random example, stackoverflow.com/a/42333832/294884 note that, of course, I bother to "72dpi - 50%" images from my Mac before including them in answers or questions, that's great. In the yellowish/greenish looking images in that example, if I had not done that, it looks absolutely crap. It would be twice the size (and indeed, furthermore, limited by column width. Almost nobody takes the care to do that, but per JDB answer, it's trivial for SO to fix.
    – Fattie
    Commented Feb 16, 2023 at 20:51
  • 6
    @Fattie Please consider for a second that not everybody will be active in the same tags as you. Other tags might not need images of tiny things like buttons. Just stop your hyperboles about this effecting all images etc. Commented Feb 16, 2023 at 20:53
  • hi @samcarter_is_at_topanswers.xyz no, i'm sorry on stackoverflow (ie, the programming site) - so I'm only talking SO, not photography, design, etc - the overwhelming use of images to to show, let's say, "UI programming problems" (which should/must be at the correct size, even setting aside the "double side looks absurd" issue) and very often questions regarding IDEs as such. I challenge anyone to find any questions on SO where the "huge" version would be correct/desired, and note that in those obscure cases, of course, ...
    – Fattie
    Commented Feb 19, 2023 at 16:34
  • .. the image should have been changed to 72d before use in the broader world anyway, exactly as one, of course, has to do when sending such critical images around to colleagues. It's pathetic that MacOS pretends 144dps (and other other high screen resolutions in unusual monitor setups) are relevant to the web and the broader world, and, SO should fix the issue since Apple won't. And again, looking at the "community wiki" answer below, the solution is totally trivial, so SO should implement it ASAP
    – Fattie
    Commented Feb 19, 2023 at 16:36
6

This is pretty easy to fix.

The Default Behavior:

When inserting an image, the default is markdown syntax:

[![enter image description here](https://i.sstatic.net/OG2hF.png)](https://i.sstatic.net/OG2hF.png)

which generates a raw img tag:

<img src="https://i.sstatic.net/OG2hF.png" alt="enter image description here">

From there, the browser takes over and just displays the image (without scaling):

enter image description here

The <img> Tag Fix:

Unfortunately, Markdown doesn’t have any syntax for resizing images. However, like many sites that support Markdown, Stack Overflow allows a limited subset of HTML, including <img> tags.

Since I use a high DPI Mac, I'll usually edit the default Markdown into an image tag of my own:

<img src="https://i.sstatic.net/OG2hF.png" width="100">

Which produces a reasonably scaled image:

The Imgur Thumbnail Fix:

Imgur's has built-in thumbnail URLs that offer various sized images. I've copied over a subset of the documentation for convenience:

Thumbnail Suffix Thumbnail Name Thumbnail Size
t Small Thumbnail 160x160
m Medium Thumbnail 320x320
l Large Thumbnail 640x640
h Huge Thumbnail 1024x1024

So the easiest way to resize a particularly large image is to slap an "l" just before the .png.

Before:

[![enter image description here](https://i.sstatic.net/nZggN.png)](https://i.sstatic.net/nZggN.png)

enter image description here

After:

[![enter image description here](https://i.sstatic.net/nZggNl.png)](https://i.sstatic.net/nZggN.png)

enter image description here

6
  • 4
    Alternatively, one can use Imgur's magic resizing syntax (explained well in this meta post), albeit with less granularity than manual <img> tags. Adding an s, m, or l to the end of the Imgur URL used for the image display will limit it to a small, medium, or large max dimension respectively. E.g. i.sstatic.net/dtiQp.png vs. i.sstatic.net/dtiQpl.png. (Do make sure not to wipe out the original image in a post though, don't want to make the image too small to be useful.)
    – zcoop98
    Commented Feb 16, 2023 at 17:58
  • JDB, this is a fantastic fix, so, SO should do that with all incoming images. I thought it would take a line of code, but, apparently hald a line only is needed.
    – Fattie
    Commented Feb 16, 2023 at 19:46
  • JDB, is there a way to apply it to all existing 144 images on SO in one fell swoop?
    – Fattie
    Commented Feb 16, 2023 at 19:47
  • @zcoop98 , that is a fantastic fix, so, SO should do that with all incoming images. .. would there be a way to do that in one fell swoop to all 144 images on SO?
    – Fattie
    Commented Feb 16, 2023 at 19:47
  • 3
    @Fattie How exactly do you propose to detect images requiring this treatment? Commented Feb 17, 2023 at 0:02
  • hi @KarlKnechtel it's not something I often program personally, nor do i program front end web (I barely understand html), but don't the various jpg formats include dpi information? quite simply, if I'm not mistaken, every single time I open a image (either jpg or png) the OS does know the DPI, so i would imagine it's simple enough / in fact trivial for either the imgur programmers or Prosus programmers to do so? Also, note that some genius has in fact totally solved the problem, see the recent edits to this answer.
    – Fattie
    Commented Feb 19, 2023 at 16:28

Not the answer you're looking for? Browse other questions tagged .