OZONE Asylum
Forums
PSPong.com - Working Area!
Site open?
This page's ID:
13181
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I'm not sure of the whole scope of what you want this script to accomplish, but here's a function using PHP and netPBM to make a thumbnail of a jpeg or gif file. <BLOCKQUOTE><FONT face="Verdana, Arial">code:</font><HR><pre><?php /* * The thumbnail function uses the pnmscale program from * the popular Netpbm image manipulation tools package * to create a thumbnail of the given image. If a thumbnail * already exists for the image, the function simply returns. */ function thumbnail($filename, $album) { global $theight; /* Define where to find the various external binaries we need */ $djpeg = "/path/to/netpbm/jpegtopnm"; /* decompresses a jpeg to ppm */ $cjpeg = "/path/to/netpbm/ppmtojpeg"; /* compreses a ppm to jpeg format */ $pnmscale = "/path/to/netpbm/pnmscale"; /* scales a ppm image */ $giftopnm = "/path/to/netpbm/giftopnm"; /* convert a gif to ppm */ $ppmtogif = "/path/to/netpbm/ppmtogif"; /* convert a ppm to gif */ $ppmquant = "/path/to/netpbm/ppmquant"; /* colour quantize a ppm */ $tdir = "/path/to/thumbnails"; /* thumbnail directory */ $tfile = $tdir."/".basename($filename); // thumbnail file if(!@is_file($tfile)) { if(ereg("\.gif$",$filename)) // Look for .gif extension { exec("$giftopnm $filename
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »