Do you mean when quoted? If not, then can you explain what you do/did in as much detail as possible that enlarges the image? This will help in answering your question.
Unfortunately I’ve not been able to fully recreate your issue. Something is misidentifying the size of the image in the Onebox, but I can’t work out how to create the conditions to get in to that state.
What value do you have for the ‘crawl images’ site setting? Having this turned on wont hurt, but I think in your case the problem is occurring slightly earlier in the flow.
To repeat what @osioke said, if you could attempt to recreate the problem and let us know the steps to do so that would be really helpful. In particular:
Does this happen on all posts, or just some?
Does it happen when the post is first created, or only after an edit to an existing post?
If it’s an edit, is it a regular user or an admin who is performing the edit?
Which device/browser are you using to create/edit the posts?
The vast majority of posts this does not occur (>95%). I simply noticed that in a few threads the occasional post by those in my community it was displaying incorrectly. When I went in to edit the post it seemed fine in preview mode, but posted incorrectly. However, If I cut the entire link text out, and then re-paste it back in. It displays how it should.
However there appears no difference in the before and after (in raw mode):
My “crawl images” is turned on.
My “create thumbnails” is turned on
Most of my settings in discourse are the default ones. Under “Files” there are a few exceptions:
" max image size kb" is set to 1000 KBs
“max image megapixels” is set to 5
“download remote images to local” is turned off.
“embed any origin” is turned on
The issue seems independent of what theme I am using. It does not happen to me, if I use the same link from a third party. What I will do is ask members of the community (who posted and had funny resizing issues) what device they were using. To try recreate the issue.
It appears to be associated with FireFox when the zoom is set at 120%.
I went backwards and forwards with one user experiencing the issue. Trying different browsers, devices etc. In short using Firefox Nightly (91.0a1 (2021-05-31) (64-bit)) at 120% zoom it causes links to not be resized.
If the zoom is adjusted back down to 110% or 100% the posts are resized perfectly.
Aha. I’ve been able to reproduce the issue based on your sleuthing.
It will happen when any thumbnail in the preview pane of the composer is less than 64px x 64px. This can be achieved by having a desktop browser resized to be really narrow, or (as you discovered) bumping up the zoom level.