Users discuss the new “scale-btn” feature in Discourse core, which allows resizing images in posts. zsero requests it for their install, learning it’s a core feature, not a plugin. After upgrading, they note issues: Retina images are resized to odd dimensions (e.g., 689x294), making 50% scaling impractical. codinghorror explains this is due to the max image width setting, which can be adjusted. zsero changes it to 1380 but reports bugs: previously uploaded images can’t be reprocessed, and scale buttons overflow visually on wide images. awesomerobot acknowledges the bug and fixes it by moving controls under the image awesomerobot. sam argues the edge case is rare. zsero clarifies the issue affects wide-but-short images, and later confirms the aspect ratio bug no longer reproduces. galligan suggests adding “2x” or “3x” options to better handle Retina screenshots, so images display at true physical size rather than being upscaled, and proposes similar behavior in lightbox view.
I’d like to have the same “scale-btn” functionality on my Discourse install as is here on Meta.
What exactly is that, a plugin? If so, does it have a name? Or it’s an unreleased version of Discourse?
I guess it’d doesn’t resample the images, just makes the browser display them at lower ratio, which is exactly what I’m looking for in all my Retina macOS screenshots. Inserting a 2x screenshot has always been a pain in Discourse, and this is exactly the perfect solution for it.
Cool, it’s working now. One issue though is that now Retina images are used and encouraged, the built-in resizing should also take care of that.
What I mean by that is that I have a screenshot, which is 1206x514 in 2x size or 603x257 in 1x size. If I upload it to my forum (or here) it automatically gets resized to 689x294, which is a very odd size. Odd, because it’s bigger than 1x size would be and also because it’s not an integer resize, so it’s blurry.
Once it’s in this size, I cannot use the 50% button as it’d be super tiny / unreadable, so I need to use the blurry/oversized 689 size.
OK, I’ve changed that setting to 1380. There are two bugs related to that:
(minor) Already uploaded images cannot be reuploaded again, it remembers them (from hash I guess) and only offers the 689 size.
The new scale buttons’s CSS go outside the view when this setting is used to allow wider images. Also the aspect ratio is wrong unless on 50% settings.
OK, I just checked and a single line of text before indeed solves it.
Also I cannot replicate the aspect ratio bug today, even though I’m trying with the very same image and I haven’t done anything with the site.
Have been experiencing some behavior, which is certainly the way it’s intended right now, but feels a little bit …off, related to the above comment.
The scenario goes:
Take a screenshot that’s roughly 500px wide, on a retina screen
Resulting image is 1000px wide
Upload to Discourse
Image gets resized to 690px and now appears to be larger than original
Given the above, it feels appropriate that in addition to the 100% / 75% / 50% buttons available now, a “2x” or “3x” option be presented. This would change the priority of resizing to always try for presenting an image at as-close-to-reality as possible first.
With the above scenario, if given the option to select an “@2x”, the image would be shown as 500px and appear true-to-size, as opposed to 690px.
This also is true with the Lightbox images themselves. I would much prefer them to open up in an @2x or @3x retina state.