Source for file thumbs.php
Documentation is available at thumbs.php
* On the fly Thumbnail generation.
* Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
* relative to the base_dir given in config.inc.php
require_once('config.inc.php');
require_once('Classes/ImageManager.php');
require_once('Classes/Thumbnail.php');
//check for img parameter in the url
//get the image and the full path to the image
$imgInfo =
@getImageSize($fullpath);
//Not an image, send default thumbnail
//show the default image, otherwise we quit!
$default =
$manager->getDefaultThumb();
header('Location: '.
$default);
//if the image is less than the thumbnail dimensions
//send the original image as thumbnail
if ($imgInfo[0] <=
$IMConfig['thumbnail_width']
&&
$imgInfo[1] <=
$IMConfig['thumbnail_height'])
header('Location: '.
$manager->getFileURL($image));
$thumbnail =
$manager->getThumbName($fullpath);
//if the thumbnail is newer, send it
header('Location: '.
$manager->getThumbURL($image));
$thumbnailer =
new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
$thumbnailer->createThumbnail($fullpath, $thumbnail);
//Check for NEW thumbnails
header('Location: '.
$manager->getThumbURL($image));
//show the default image, otherwise we quit!
$default =
$manager->getDefaultThumb();
header('Location: '.
$default);
Documentation generated on Mon, 05 May 2008 16:23:17 +0400 by phpDocumentor 1.4.0