I have developed a forum. User are able to insert HTML tags directly. So user can paste a code like:
sometimes it has the width and height attribute
" width="1000" />
But I want to limit the max image size automatically, so it will not stretch out the fixed forum length if the image is larger, is that possible?
What I want to do is:
1. if the "width" is already set but it's greater than the max permitted like 500px, then change it to 500px
2. If it does not have the width, then just add the width
3. It should not slow down the speed by loading the remote image file remotely using php functions to find out the width