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
Quote: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.

I use a plugin for my site to check avatar size and reject anything over the limit.
Well, it is more the wish to reduce avatar proportions - like with avatars on index - or maybe having a post avatar smaller than a profile avatar. Even the "resizing" of the avatar for memberlist is just html.
(2012-06-21, 07:35 PM)sunjava1 Wrote: [ -> ]I am using image attachments to display on index page
If you're using the thumbnail, it's pre-scaled down.
If you're using the link to the actual attachment (ie attachment.php?some_crap) in an <img> tag, then:
- users are downloading the full image every time
- attachments are explicitly declared as no-cache, so every time the user visits they page, they'll get a new copy, even if they already have one
- your server enjoys firing an additional PHP process, which is used to read the entire image into memory (ala file_get_contents) and then feed it out every time
- oh, and lame-os using Firefox 2 or earlier get to see what nearest-neighbor resampling does to images... at least IE6 uses a blurry bilinear scaler

Just resize the image yourself and upload it it somewhere on your server and link to that. No need for GD/CSS/HTML/JQuery or an axe.
In my opinion Html/CSS both are the bestway to resize the image. But Html gives accurate result to resize image as it have option of <img> tag.
but I have dynamic images i.e. image attachments from the post
Pages: 1 2