phpimageresize-imagephpthumb

best practice of generating thumbnail?


I am creating a social network where users upload their profile image.

This image will be used in their profile page in 150 / 150 px dimension.

In the home page i.e user Activity feed I need the same image to be in 75 / 75 px.

What would be the best practice to do this

  1. Resize image on fly (timthumb).
  2. Resize and Save image in the server.

Solution

  • While uploading a photo create required set of thumbnails and save as a [image_name]thumb[size_name].jpg or so:

    uploaded: file.jpg
    medium: file_thumb_150x150.jpg
    small: file_thumb_75x75.jpg
    

    Naming convention is up to you, but in a fast way you get easy access to the data you need. No need to use server to generate it on the fly or scale in a browser.