MyBB Community Forums

Full Version: What is the best way to show resized image
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
What is the best way to show resized image for fast image processing ?

1. HTML
2. CSS
3. PHP GD
GD is obviously not the best. CSS/HTML are basically the same though. I personally prefer to keep stuff like that to CSS, though having a defined height/width on an image within the tag is deemed to be good practise according to pagespeed/yslow.
GD is a bad way of doing it, unless you physically use GD to change the image size when it is uploaded, then no further resizing is needed Smile
Same as euantor. CSS is widely used for CSS sprites etc.
I have a image of 640 x 400 and i am displaying its thmbnail on the main page with css, and i guess this causes page speed slow down any fixes ?
Give more context to what the image represents ... is it attached to a thread or a user or what?
What many sites do with something like that is resize the image using GD once, then save that resized version somewhere in the file system (i.e. ./images/thumbnails/) and simply serve that thumbnail from then on. It's much faster since you're not transmitting the whole image, just the reduced thumbnail, and you're not resizing it every time someone asks for it, since it's already done.
Create thumbnail with GD and save it then offer full size version when clicked.
I am using image attachments to display on index page
as already said - resizing in css is still downloading the whole image - which is a bit daft IMO. I do it - and I hate myself for it Big Grin - but I cannot think of a really better way for some things.

My biggest culprit for this is avatars, otherwise I use XThreads or MYBB image attachments and do NO resizing in css.

It would be cool to be able to define avatar sizes a bit better, and to have them cacheable - right now that query string is playing havoc with my caching strategy.
Pages: 1 2