SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot DocDave's Avatar
    Join Date
    Sep 2004
    Location
    Milwaukee, WI, USA
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP or JPG for thumbnails

    Question:
    Should I use PHP to create a thumbnail dynamically upon demand or use traditional style JPG thumbnails.

    I done tests and both seem to load about the same. But then I am on a broadband connection. Any idea which works better?
    .:Blog:.

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Mexico
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think it matter. The time used on loading an image is much larger than the time loading a script. Plus remember this script is done on the server and not the client which also add's to my point.

    I think you should use PHP for speed on development and management reasons. To really increase your clients experience you would need to study more the options of using GD. Things like optimizers, transform to a indexed colors (sacrifiying quality) and also learn about the parameters of the resize.

    Anti-alias, interpolation, cubic vs linear and cuadratic algorithm.
    Alexandro Colorado

  3. #3
    SitePoint Addict Chillijam's Avatar
    Join Date
    Nov 2003
    Location
    England
    Posts
    293
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It depends on how busy the server is as well. If you have lots of hits on the thumbnails, it would probably be worth coding something in an upload page, so that when an image is uploaded, the thumbnail is autopmatically generated and saved ready to serve as a "normal" jpg.

    That's how I'd do it, anyway.
    Your mind is like a parachute. It works best when open.
    (HH The Dalai Lama)

  4. #4
    SitePoint Zealot DocDave's Avatar
    Join Date
    Sep 2004
    Location
    Milwaukee, WI, USA
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the feedback. I am leaning towards generating the images using PHP. I will have to see how it taxes the server.
    .:Blog:.

  5. #5
    SitePoint Addict thoresson's Avatar
    Join Date
    Dec 2002
    Location
    Gothenburg, Sweden
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I second the solution of creating the thumbnails at upload. That's how I do it, and sometimes, when I upload a large image, the script times out. One could either allow longer execution times or resize the image before upload. In either way, I think it's better that I have a timeout at upload then visitors to my website.
    //Anders


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •