Generating thumbnails on the fly
View Single Post
12-09-2008, 07:25 AM
Join Date: Dec 2007
Originally Posted by
I have a site that lets a user create multiple galleries. For each gallery they can upload an image to be the image for that gallery.
I want to generate a thumbnail for each gallery to display on a page, however depending on the template they have selected (in another part of the control panel) the thumbnails should be a different size.
Am I better off generating the thumbnails (either using PHPThumb or the GD library) on the fly each time this page is loaded or should I generate the thumbs as the gallery is created and then re-generate all of the current thumbs if/when they change their template?
What I would do is generate the thumbs as the gallery is created, and regenerate the thumbs when they change their template.
From my experience, it seems if you resize thumbs straight from a php file, it's slower than actually generating them and storing them in a cache, so I would cache the thumbnails, and put a path in the database to the thumbnail, in which you could use <img src="" /> to fetch the image from the path, so being it's faster than generating straight from a php file.
"The reasonable man adapts himself to the conditions that surround him... The unreasonable man adapts surrounding conditions to himself... All progress depends on the unreasonable man." - George Bernard Shaw
Last edited by Orc : 12-09-2008 at
View Public Profile
Send a private message to Orc
Visit Orc's homepage!
Find More Posts by Orc