I typed this out a couple of days ago when the couple of forum changes occurred, but then deleted the topic when I saw that after submitting a post, image aspect ratio and resizing worked correctly after a post is submitted. However, when composing a post, the issue exists which makes formatting posts that contain images really quite annoying now. So, I’m going to copy in what I wrote before I deleted my topic, But do note that what I am mentioning below is happening to the post preview when composing a post and not in the actual post after it’s submitted and displayed on the page (at least on desktop…I’ve not posted anything from mobile since the change). So, it’s mostly an issue when trying to make a new post or edit a post and not when actually reading already posted forum posts. It’s still very annoying; however, I realize that it’s a niche problem, with the number of people actually making use of image resizing probably being quite low.
Here’s the original post (again, only applies to the post preview from what I can tell):
I don’t know if this is a new bug or if this is working as intended, but i wanted to report it in case this wasn’t the intended effect.
Prior to the updates to the forum today, if you used the parameters in the image markdown to set height and width, the forum would ignore whatever you put for the width and would instead just scale the image by using the width parameter and preserving the aspect ratio.
Now, the forum does use both the height and width parameters you can supply, except instead of scaling
Example:
A. Original size (600x338) and aspect ratio (16:9):
B. Resized with correct aspect-ratio 400x225 (16:9):
![at 400x225|400x225](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYmZkNTBhOGEyNjhjYjE0MjQ0Y2MwYmJiYzEyNWYwYjkzYzBlMTlhMyZjdD1n/AUUOv3TkqsrZEGEvMK/giphy.gif)
C. Width set to 400 but using a height higher than 225 (400x300):
Prior to today, this would have previously auto-scaled the height down to 225 when the image is displayed maintaining the aspect ratio.
![at 400x300|400x300](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYmZkNTBhOGEyNjhjYjE0MjQ0Y2MwYmJiYzEyNWYwYjkzYzBlMTlhMyZjdD1n/AUUOv3TkqsrZEGEvMK/giphy.gif)
D. Width set to 400 but using a height lower than 225 (400x120):
Prior to today, this would have previously auto-scaled the height up to 225 when the image is displayed, maintaining the aspect ratio.
![at 400x120|400x120](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExYmZkNTBhOGEyNjhjYjE0MjQ0Y2MwYmJiYzEyNWYwYjkzYzBlMTlhMyZjdD1n/AUUOv3TkqsrZEGEvMK/giphy.gif)
E. Because the other image is 600 pixels wide and the forum limit is fairly close to that, I’ve used a different image (base resolution of 400x225) as an example for scaling up on the forums now. Using 600x150 as the target resize, in the past it would have preserved the aspect ratio and scaled this to 600x338 for display, ignoring the height. Here’s what it looks like with today’s changes:
So, now with the update, the forum does display the image with a resolution that you specify (400x338 or 400x168 in the examples above), except it also doesn’t actually scale the image in both the vertical and horizontal directions ***unless you’ve set a resize resolution that is exactly the same aspect ratio at the image originally was: see the 400x225 ).
Instead, we get one of two results if the resize height and width we enter does not match the original aspect ratio:
- when resized aspect ratio is shorter than the original (example D): what appears to just be horizontal scaling but with the y-axis being cropped (like vertical- field of view).
- when the resized aspect ratio is taller than the original (example C): what seems to be vertical scaling but with the x-axis being cropped instead (like a horizontal+ field of view).
…what I would have expected with the change is for the forum to scale the image to the new aspect ratio (~6:5 for 400x338, 10:3 for 400x150 etc).
Manually resized myself to 400x338:
Manually resized myself to 400x150:
I don’t know if discourse’s min_ratio_to_crop
got changed today or if something else is resulting in this. Actually having control over the height now is nice, but having the forum crop images instead of actually fully scaling to the new aspect ratio of the new height and width is unexpected.