TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-08-2008, 11:27 AM   #1 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default Generating thumbnails on the fly

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?
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 12-09-2008, 07:25 AM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Jmz View Post
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.
__________________
VillageIdiot can have my babbies ;d

Last edited by Orc : 12-09-2008 at 11:11 AM.
Orc is offline  
Reply With Quote
Old 12-09-2008, 03:07 PM   #3 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

Ok thanks, I'll do that.

Any idea which would be better to use? PHPThumb, GD or something else?
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 12-10-2008, 12:34 AM   #4 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Jmz View Post
Ok thanks, I'll do that.

Any idea which would be better to use? PHPThumb, GD or something else?
What is PHPThumb? Is it an external library outside of PHPs core?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 12-10-2008, 09:10 AM   #5 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

You can see the PHPThumb site here. I've never used it before but the wordpress skin I use for one of my sites uses it.

Apparently it uses the GD library and ImageMagick to produce the thumbnails. I was just wondering what benefits it has over using the GD library itself.
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 12-10-2008, 09:17 AM   #6 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Jmz View Post
You can see the PHPThumb site here. I've never used it before but the wordpress skin I use for one of my sites uses it.

Apparently it uses the GD library and ImageMagick to produce the thumbnails. I was just wondering what benefits it has over using the GD library itself.
Well if it improves the GD Library, I would go with it. Although ImageMagick isn't part of the PHP Core, but if you have a dedicated server you could install it, or contact your host to install it.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating XML from a Mysql DB with PHP's DOM functions (part one) sketchMedia XML, XSLT, XPath, XQuery 10 03-05-2013 07:41 AM
Generating XML from a Mysql DB with PHP's DOM functions (part Two) sketchMedia XML, XSLT, XPath, XQuery 7 08-20-2008 12:02 AM
Generating a barchart with "different starts" ProbablyX General 0 05-23-2008 09:32 AM
Creating Image Thumbnails WITHOUT header() aristoworks General 3 01-24-2008 11:42 PM
Thumbnails from a directory Rendair Script Giveaway 4 12-04-2007 03:57 PM


All times are GMT. The time now is 01:51 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design