Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Browser Resize image question
Closed Thread
Old 07-22-2007, 02:18 AM   #1 (permalink)
 
True Techie

Join Date: Apr 2005

Posts: 110

Murdoc

Default Browser Resize image question

Hello all, I would like to ask if I have a large image say 500 x 500 and I want to use the photo again in a thumbnail as well (by shrinking it down to 100 x 100) would it be better to just create a 100 x 100 image or ask the browser to resize?

The major things i'm considering here are 1) Loading speed 2) Quality of the picture 3) Bandwidth conservation.

The reason I'm considering this is because I've read online articles about reusing images. They claim that since the browser caches images if I reuse the very same image it won't need to reload the image thus saving bandwidth. My question now is what if I need to resize it? Will it still be just as fast? Would there be a significant loss in quality?
Murdoc is offline  
Old 07-23-2007, 04:22 PM   #2 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Default Re: Browser Resize image question

You want both sizes - the "thumbnail" size and the "display size" - as separate images.

You never want to depend on the browser resizing the images--especially if they're large (file size), unless you know that the user guaranteed to open the larger version--as that would dramatically effect your loading speed/bandwidth, dependent on the quality of the original.

Generally speaking, it's a good idea to have the pictures pre-sized on the server, eg, a directory \images, \thumbnails, \original or something along those lines, and use them accordingly. Another option, which would use some CPU power every time, would be to have just the original and have a server-side script manipulate/resize the image...saving you some HDD space, but unless that's needed, I'd stick with the pre-sized ones.

Caching the images does indeed work, presuming the user's cache size is large enough (usually not a problem), but it'll be forking over the full image each time, regardless if the user just opens the page and decides to only open one of the pictures. And in doing that, they'll be waiting for the full image to load, even though the image is smaller on the screen.

Also, quality can be bad when the browser resizes the image--but that's usually not a big issue since it's a thumbnail and they're minor annoyances..

Now, if you know they're going to open every picture, you could do it the browser-controlled way, just prepare for the page to take a few minutes to load (which the general public would frown upon :happy.
__________________
Vormund is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Image problem cool.blue Windows Operating Systems and Software 0 07-11-2007 10:32 AM
Incredibly simple question IfYouHaveToAsk Browser & General Internet Questions 2 05-10-2007 11:36 AM
Help with a Browser for my Razr V3i DerekGoodson Phones – PDA’s – Bluetooth – Other handhelds 2 04-19-2007 09:33 PM
Case Fan Question Shafra Overclocking, Case Mod, Tweaking PC Performance 10 04-18-2007 06:42 PM
Hard Drive Image question carnageX Hardware Troubleshooting 26 04-13-2007 08:02 PM