Hiya! I’ve just set up an instance of discourse and I wondered, is there an easy way for images to be resized after a use has uploaded them? I’ve had quite a few people use the board already with images that are a few MB each!
Thanks,
Jack
AI-generated summary
In a Support thread titled Resizing images after user has uploaded automatically, jackjjw asks if Discourse can automatically resize large uploaded images, noting users are uploading multi-MB files. pfaffman reassures that images are resized by default, though jackjjw initially sees no change. After further investigation, jackjjw finds and adjusts the Max Image Size setting under Site Settings to 1000KB to control storage costs on their gardening forum, noting it only affects new uploads. Canapin asks which setting was changed, leading jackjjw to clarify it’s Settings > Max Image Size, and confirms it works on both mobile and desktop. codinghorror warns that overly restrictive limits may deter users, but later clarifies jackjjw isn’t blocking uploads — just resizing them — which he finds acceptable for cost control. Canapin notes they missed the setting’s description, which explains that images between the max size and client_max_body_size are resized on upload — a key detail for understanding the behavior. The discussion ends with consensus that resizing (not blocking) is a practical, user-friendly compromise for non-profit sites managing storage costs.
Do nothing. They will be resized. If you search, you can find some discussion about it.
Oh right, they don’t seem to have changed yet - I did search but will have another look, thanks.
Hiya, they still aren’t resizing, have I missed something really obvious?
You will need to edit your image related site settings if you want to clamp down on uploads so hard. A few megabytes isn’t a big deal for an image.
If you’re worried about running out of local storage on the server have you considered moving uploads into S3?
Ah brill, thank you I found the setting and have adjusted it. I run a gardening board so it will become full of photos quite quickly which could become costly for a non-profit making site (at the moment). Thank for you help.
What is the setting name you changed?
I’m not sure what that means lol but I will ask my more technical partner to explain to me. Thank you.
Settings > Max Image size
I changed it to 1000kb for now. I was thrown because it didn’t change existing images, only newly uploaded ones. I might up the size in time but as a new board, I wanted to catch huge images early!
I believed that decreasing this setting would make Discourse throw an error if someone wanted to send a heavier image, which I guess would prevent a lot of people from uploading an image from their smartphone where the photos aren’t much compressed… ![]()
Oh right, I just managed to upload one from my laptop but will check from my phone too
I just checked on mobile and laptop and it seems to work unless there’s an extra use case I’m missing? Tested on iphone and mac
Fair warning, in my opinion you are throwing the baby out with the bathwater here. People aren’t likely to return to a site that prohibits them from sharing an image over 1 megabyte in size.
It’s your site so you can do as you please but I expect people not to return once they run into that severe limitation.
Thanks Jeff, it doesn’t feel like a limitation to me because they can post, it just keeps the file size low. The images are still large and high quality for sharing purposes. I’ll keep an eye on it over time. At the moment, if I allow 4 - 8MB images on my server, the cost of hosting after a year of content could be in the hundreds of pounds, which I can’t afford.
Oh, that’s fair – much better approach. I thought you were blocking all uploads greater than 1MB in size.
Oh I see what you mean, no definitely not, just resizing them
It seems I never read the end of the max image size kb setting description, which provides a key info I had no clue about.
Images larger than this and smaller than client_max_body_size will be resized to fit on upload.
Good to know!