I tried BBCODE and markdown in two ways to introduce a picture, but he could not control the size. How to control the size of the picture

![](https://discuss.flarum.org/assets/header.png)
and
[img]https://discuss.flarum.org/assets/header.png[/img]
How to control the size of the picture?

The display is as follows:

and

Markdown and BBCode are not meant to provide any control over the display of the image. The image stays at its original size. Flarum only applies a rule to resize the image if the viewport is too narrow.

    Originally [img width={width} height={height} ...]{url}[/img] or [img={width}x{height}]{url}[/img] would be used for BBCode, as for Markdown something like ![](./pic/pic1_50.png =100x20) should be possible depeneding on if the editor has resize implemented, which I'm not sure it does.

    jordanjay29 I've just added width/height attributes to the default IMG BBCode so they will become usable in whichever version of Flarum uses the next version of the library. I have no plan to add support for dimensions in the Litedown plugin though.

    If you want to support dimensions in Flarum's Markdown extension you can use a custom match for it:

    $configurator->Preg->match(
    	'/!\\[(?<alt>.*?)\\]\\((?<src>\\S+)(?: =(?<width>\\d+)x(?<height>\\d+))?\\)/',
    	'IMG'
    );
    3 years later

    Is this implemented on b14 or not? Because it's a big + if we can add an image size

      Amarok Flarum is using the latest version of TextFormatter, so I imagine the changes mentioned by @JoshyPHP are available. You can give it a test under our test tag here or on our demo forums if you don't have a forum to check yourself.

        The commit linked by JoshyPHP seems to indicate this was added for bbcode only.

        Markdown compatibility seems to be possible with the snippet shared in his post.

        This seems to work:

        [img width=30 height=30]https://discuss.flarum.org/assets/header.png[/img]