I have a bbcode parser that turns,
[img]imageurl[/img]
bbcodes into,
<img src="imageurl" alt="" />
The only problem is, I want to be able to enforce a maximum width and maximum height on these images without messing up the aspect ratio, but I cannot check the size and do resizing math before hand since the bbcode parser is not that smart. Is there a way to enforce an aspect ratio respecting maximum size of an image without any knowledge of the image’s dimensions using inline css or javascript?
I know I could change the bbcode parser to set a maxwidth for the tag’s style, but this does not seem to work on IE6.
use css:
probably combine with a container, so you only have images inside your bbcoded posts max-sized instead of every image on your site: