Markdown for image resize by px, not percent

Ahhhhh @sam, thank you for the redirection. The current functionality is PERFECT, if I’m understanding correctly now.

Let’s see if I’ve got this right…

  • “x” represents “auto”
  • if I use “x” before number it will represent width. e.g. x150 = "width: auto; height: 150px;"
  • if I use “x” after a number it will represent height. e.g. 150x = "width: 150px; height: auto;"

––––––––––––––––––––––––––––––––––––

Let’s test that out with this image that is "width:600px; height: 200px;"

The default embed syntax is:

![we love discourse|600x200](upload://gvBLukUHTZLicvbieEMWVlBj9OK.png)

which looks like…

we love discourse

The following image has been scaled to a width of 200px (height = x = auto):

![we love discourse|600x200,200x](upload://gvBLukUHTZLicvbieEMWVlBj9OK.png)

which looks like:

we love discourse

The following image has been scaled to a height of 100px (width = x = auto):

![we love discourse|600x200,x100](upload://gvBLukUHTZLicvbieEMWVlBj9OK.png)

which looks like:

we love discourse

––––––––––––––––––––––––––––––––––––

That seems to be working like a charm. So glad to understand, and now be able to use this!

Thanks @sam for the quick response! :raised_hands:

9 Likes