Jump to content

Recommended Posts

I've seen a lot of posts regarding how to create thumbnails, but I haven't seen anything regarding WHEN to create the thumbnail (i.e., during the original image upload, before displaying the image, etc.), or if it's even worth it to use thumbnails.

 

Our website is a listing service for real estate.  Each listing can have up to 4 jpg/gif images up to 500k in size each.  On a page, we can have up to either 10 or 25 listings.

 

My first question is, when should I create these thumbnail images (i.e., during the original image upload, before displaying the image, etc.)?

 

My second question is, is it even worth it to create thumbnails, or can I just display the original images and just resize them in the <IMG> tag?  How server intensive is creating these images?  Is it even worth it to create thumnails, or should I just continue with displaying the original image?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/62696-to-use-thumbnails-or-not/
Share on other sites

create the thumbnails on upload.  That way you create the file once and its saved on your server and can easily be called and read over and over again.

 

if you create them "on the fly" it has to be built over and over again each time a user sees it.  The purpose of thumbnails is so the user doesn't have to download the full size version of an image (unless they want to click on it) -- if you don't create the thumbnail until they view it - then they still have to wait for the full image to be processed each time.  (only its being processed on your server, instead of in their browser)

 

as to your 2nd question - do the thumbnails.  even though a lot of people have lightning fast internet connections -- it is STILL very annoying to download a 500k image (albeit reshaped in the IMG tag) and it is a huge waste of bandwidth. both yours and theirs.

Cool!  Thanks!  Yeah, that makes sense.  I don't know why I had it in my head to create them just before displaying them.  Duh!  Oh well.  That's how you learn.

 

Also, I've seen several examples for creating thumbnails, and was just wondering if there's a "preferred" way of doing it?  All the variations make use of the following functions:  imageCreateFromJPEG, imageSX, imageSY, ImageCreateTrueColor, imageCopyResampled, imageJPEG, imagedestroy, etc.  Any caveats in actually creating the thumbnails?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.