Image resize BBCode?

Support for PhpBB3 BBCodes.
Post here to get help with any BBCode related issue
Forum rules
In order the get any support, you will have to do following:
1. Use a describing title!
2. Describe exactly what it is you want.
3. Tell us what version of phpBB3 you are currently using.
Else your topic may be ignored or locked!

Image resize BBCode?

Post by Holger »

Hello,

sometimes an image within the IMG-tags is blown up in size, even if the pixles does not allow that anbd that makes the image look blurry or pixelated.

Is there any solution like

Code: Select all

[img 400,400]https://image-URL[/img]
so that the image within the IMG-tag is limited to 400 pixels in width and height?
Maybe one dimension would be enough

Code: Select all

[img 400]https://image-URL[/img]
limiting the width.

Any takers?



EDIT: I just found this: https://www.phpbb.com/community/viewtop ... #p13072784
Does that work?

Image resize BBCode?

Post by Steve »

this will prevent any image posted using the img bbcode or via attachments being over the size set below:

Code: Select all

.postimage img {
	max-width: 400px;
	height: auto;
}
but you need to add to a css file, or you can recreate the img bbcode. IIRC there was an img size bbcode some where.

Image resize BBCode?

Post by Holger »

Thank you!
Well I am looking for a possibility for the users to set the width by themselves.
Becaus, most photos/images are perfect, no need to restrict, but sometimes the photo/image would be better smaller without resizing it with photoshop or Irfanview or similar.

Image resize BBCode?

Post by Steve »

BBCode usage:

Code: Select all

[img_r={NUMBER}]{URL}[/img_r]
HTML replacement:

Code: Select all

<img src="{URL}" style=" max-width: {NUMBER}px;height: auto;" loading="lazy" alt="Image" />

Code: Select all

[img_r=100]https://phpbb3bbcodes.com/ext/stoker/styleedits/styles/prosilver/theme/images/webp/styleedits10.webp[/img_r]

Image resize BBCode?

Post by Holger »

Wow, thank you! I will try that!

Image resize BBCode?

Post by Stoker »

Man, i was sure we already had this?
I remember a reimg bbcode..

Anyway, here is a new one: viewtopic.php?t=3010