By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,077 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,077 IT Pros & Developers. It's quick & easy.

Displaying a Thumbnail vs. creating a thumbnail

P: n/a
Hello,

I'm wondering whats the best method to use for displaying several photos'
thumbnails. One method I know is to dynamically resize the photo at the time
the page is loaded. What does this do to server/site performance? The other
is to copy the photo at time of upload and create a thumbnail then, have two
separate images, therefor when displaying its just pulling the actual image.

What do you think??

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


Feb 1 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
David Lozzi wrote:
Hello,

I'm wondering whats the best method to use for displaying several photos'
thumbnails. One method I know is to dynamically resize the photo at the time
the page is loaded. What does this do to server/site performance? The other
is to copy the photo at time of upload and create a thumbnail then, have two
separate images, therefor when displaying its just pulling the actual image.

What do you think??


Creating thumbnails on the fly, every single time they're displayed is
CPU intensive (especially if there are a good number of visitors at the
same time). And if your images are big it can also generate a good
amount of disk IO (assuming images don't have built-in thumbnails or
that you don't use them - actually generating them), say you're
displaying 50 images/page, and that the source is 50 ~1MB jpegs, then it
has 50MB of images to read from disk before it can even resize them
(that's a lot of data to process too), for every single page load.

What I usually do is look for the thumbnail at page load, if it's not
there then generate it and save a copy to the disk for future page loads
(only needs to be generated once). That way there's no issue of
maintaining thumbnails either (like, if someone adds pics to the site by
FTP'ing them or such, your upload page won't generate thumbnails, then
what? What if they got deleted? etc)
Feb 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.