coding, hacking, startups, computer security, technology and more
Automatically Resizing Image Attachment Uploads With PHPBB
I manage a number of PHPBB bulletin boards and one such board receives quite alot of image uploads from users who let's say aren't the most tech saavy. Some of the users know nothing about image file sizes and resolution and they end up uploading enormous images. Rather than instruct each user how they can resize images I figured it would be better if PHPBB would just resize the image on the fly so that the dimensions ensure better file sizes and don't break the layout of the site. I checked the PHPBB administration control panel and it seems that this simple requirement's not possible out of the box. Googling a little for it didn't show up much so I dived in to the source..
How to get PHPBB to automatically resize uploaded images?
I applied this mod to PHPBB3, it would not surprise me thou if this also applied cleanly to a PHPBB2 installation. Open ./includes/functions_posting.php and locate the following line (~ line 434):