Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: pictureposter on May 12, 2022, 05:19:03 AM

Title: Add image width to the [img] tag
Post by: pictureposter on May 12, 2022, 05:19:03 AM
Posting large images break the formatting of a post and reach out far to the right with essential parts hidden.

As large images are often necessary to provide the details one needs to transport (think of text and noted in plans or circuit diagrams), uploading a scaled down version to not to break the post formatting is often not possible.

Hence, I want to suggest to make a very simple to implement, but easy solution to the problem: Add an optional width tag to the [img] tag.

If it's available [img width="250"][/imp], it's rendered to the html <img width="250"></image> tag.
If it's not available [img width="250"][/imp], the width is added with a default value like <img width="800"></image> (or whatever is sensible for most of the installations or even dependent on eventually existing settings. I am not familiar enough to know the details).

This would enhance usability extremely with close to none effort.

Thanks for consideration!
Title: Re: Add image width to the [img] tag
Post by: Arantor on May 12, 2022, 05:25:41 AM
SMF has supported the width parameter for at least 10 years (I don't remember if it was in 1.1 but it's definitely in 2.0) and it's tagged as optional.

I don't remember if 2.1's theme sets a proportional max-width in the CSS though (since you don't always want to force the size to a pixel width if the size is wider than a device)
Title: Re: Add image width to the [img] tag
Post by: shadav on May 12, 2022, 10:10:26 AM
pretty sure 2.1 has images set for responsiveness, most theme developers add extra/better css to image tags though
and well there's also in the admin settings to set max width and height for images as well

but yeah for the bbc pretty sure that's always been there, it's just not used by people often
Title: Re: Add image width to the [img] tag
Post by: FrizzleFried on May 12, 2022, 10:32:17 AM
Stock IMG:

(https://cdn.pixabay.com/photo/2017/08/25/21/47/confused-2681507_960_720.jpg)

IMG width=250 (no quotes around number ...though it may worth WITH?)

(https://cdn.pixabay.com/photo/2017/08/25/21/47/confused-2681507_960_720.jpg)

IMG width=100

(https://cdn.pixabay.com/photo/2017/08/25/21/47/confused-2681507_960_720.jpg)
Title: Re: Add image width to the [img] tag
Post by: Oldiesmann on May 16, 2022, 09:59:24 PM
Quote from: Arantor on May 12, 2022, 05:25:41 AMSMF has supported the width parameter for at least 10 years (I don't remember if it was in 1.1 but it's definitely in 2.0) and it's tagged as optional.

It was definitely in 1.1 and I think it was in 1.0 as well.