Resize Images Automatically in PHPBB

I’ve spent the last year building a PHPBB based discussion forum. I’m using version 2 of PHPBB, with a tables based template. Yeah, it kills me… but I haven’t had the free time to invest in a CSS structure overhaul… and honestly I don’t think I know enough right now to pull it off.

I allow images to be embedded into posts by users, but images are posted that are too wide for the message area, and the format of the whole site gets broken. The header tool bar stretches, and there’s some nasty sideways scrolling introduced.

While browsing through the MODS database I came across the Resize Posted Images Based on Max Width MOD. My installation is pretty heavily modded, with a lot of that being changes I’ve made by hand in full ignorance of how things should be done properly. Regardless, the MOD installed instantly with EasyMOD and works flawlessly.

The result uses Javascript to automatically resize images that are wider than a dimension you set (default is 400px). The resized image keeps your site’s formatting correct, and the user can click on the image to see the full size copy in a pop-up window. My only gripe right now is that since the resize is done with Javascript, the user still has to download the full-size image file before they can load the page. This means that users who embed a 5meg image are still going to cripple the page. Of course, to truly resize the image and create a thumbnail would take a much heavier MOD.

If you run a PHPBB forum and find your site layout getting broken by images, I highly recommend this MOD.

Chris Owens