Default Image Size in Posts

Hi,

I am having trouble finding an answer for this issue. Images always appear too small when I add them to a post. It doesn’t seem to matter what size I make them. Is there any way to get Discourse to default the image sizing in posts to fill the width of the post and let the height fall wherever it would naturally at that size?

Thanks,
Scot

Example: The image below is the width of a post but it will appear smaller in the post. How do I make it appear at full size or at least as wide as the post if it is wider than the post width?

Hi Scot,

Because of the variety of image sizes that can be uploaded to a Discourse site, you can’t specify the default size that an image will be. However, you can set the max image width and max image height (in pixels) for all images on a site through the Admin → Site Settings menu.

Images that are originally larger than the max image width/height will be automatically scaled down to meet the max width/height requirements of the site. For example, the following image was originally 1207x186, but when uploading the image here, it automatically gets scaled to 690x106]:

![image|690x106](upload://rm3NOR98dZypAufzIFgBpZ3u2HV.png)

Note that the image will still be the same size if we manually set the original width/height:

![image|1207x186](upload://rm3NOR98dZypAufzIFgBpZ3u2HV.png)

It looks like this is what’s happening with the image you attached here, as the height of your image is getting set to 500 because the image is larger than the maximum allowed size for Meta (690x500).

![Screen Shot 2022-08-08 at 11.40.36 AM|484x500](upload://6Ga5xkEnYhlJeSccKEDXXJMuBAs.png)

You could to scale your image to 690x500 so that the image is full width, but this would also scale the image to have different dimensions than the original.

![Screen Shot 2022-08-08 at 11.40.36 AM|690x500](upload://6Ga5xkEnYhlJeSccKEDXXJMuBAs.png)

Adjusting the size of your image before uploading to Discourse, while keeping in mind the maximum dimension that the image can be, is the best way to ensure your images get displayed as intended.

Also, note that changing the max image width or height in the site settings will not retroactively impact the size of images that have already been uploaded to a Discourse site.

I hope this helps!

4 Likes

This is a big help thanks. I presume then that 690 is the max width I can use because that is the default max width of any post on Discourse. Correct?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.