• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Has anyone implemented server side image resizing for Xenforo?

TrevC

Well-known member
#1
As the title states, I really wish Xenforo included some server-side image resizing features. I don't see CSS resizing + file upload limits as being very practical or user-friendly. Has anyone ever implemented a solution to this problem?

Ideally, we could keep an upload limit of something larger(like 10-15mb per file), preventing the unfriendly file-size error messages when visitors upload photos. Xenforo would then use some PHP/graphics library magic for resizing to a specific max-width/length.

I realise this could easily eat up a good chunk of server memory and CPU time. However, I think it's worth it considering the benefits.
 

ManOnDaMoon

Well-known member
#2
XenForo already resizes some images, especially avatars that are saved under 3 different sizes: small 48x48, medium 96x96 & large 192x192.

But it seems there are limitations on which file size the server can proceed, due to memory issues, see XenForo_Image_Abstract::canResize() :
PHP:
pubmic static function canResize($width, $height)
{
	// only resize up to approximately 16MP due to memory issues
	return (($width * $height) < 16000000);
}
 

ManOnDaMoon

Well-known member
#3
Maybe this limit depends on which image library is used. This is an option in ACP > Options > Attachments : "Default Image Processor".
 

TrevC

Well-known member
#4
Thanks for the info. I wonder if anyone has done a mash-up with that function and the existing attachment system.

RAM isn't much of a concern, we'd much rather add a few more gigs and have server resized images. :)
 

TrevC

Well-known member
#5
We've solved this by re-purposing the Xenforo "thumbnails" function (and hacking templates) to become 1024x1024 contained images in posts, which of course link to the originals. Bingo! seamless server-side image re-sizing. IMO, browser resized images are a very ugly solution when every large image is being scaled client-side.

We've stress tested it with piles of 5mb images. GD's still happy. It's no problem for a modern Xeon with 2 gigs of memory and RAID SSD's. Post/PHP limits had to be increased somewhere, I'm not sure what our sysadmin did specifically. This solution drastically improves load times and scrolling performance, especially on mobile devices.

Now, where can we tweak GD settings to strip EXIF data and other options?

 

TrevC

Well-known member
#7
It is, yes. I'm specifically curious about the Xenforo implementation of GD, and where the settings for it can be tweaked.
 

erich37

Well-known member
#8
boahhhh.... this Editor looks very nice!!!! (y)

This editor is something special and looks very much user-friendly.
As with the current XF-editor, the average user is not able to even find the button of how to upload an image.


Is this XenForo ?
May I have a look at your website, please ? :)
 

TrevC

Well-known member
#9
Yep, it's Xenforo. Heavily customised (plenty of template hacks and I re-wrote most of the styles).

Xenforo is a great base, but it has some usability and design issues. I also think the stock styles and most Xenforo themes look fairly old fashioned and unnecessarily cluttered.

It's getting better every day, but is fairly tedious work.




 

erich37

Well-known member
#10
Xenforo is a great base, but it has some usability and design issues. I also think the stock styles and most Xenforo themes look fairly old fashioned and unnecessarily cluttered.
totally agree.

Oh, I do remember your OMEGA website. It looks fabulous now and seems to be very easy to use.