This function will create a square thumbnail image from an already uploaded image on your server.
Quote
createsquarethumbnail ( string $filetype , string $origfile , string $thumbfile, integer $new_size )
<?php
require_once INCLUDES."photo_functions_include.php";
// Set variables
$origfile = IMAGES."banner.png";
$thumbfile = IMAGES."banner_squarethumb.png";
$new_size = 100;
// Determine file extention
$fileext = substr($origfile, strrpos($origfile, '.') + 1);
if ($fileext == "gif") { $filetype = 1;
} elseif ($fileext == "jpg") { $filetype = 2;
} elseif ($fileext == "png") { $filetype = 3;
} else { $filetype = false; }
// Create thumbnail
if ($filetype) {
createsquarethumbnail($filetype, $origfile, $thumbfile, $new_size);
echo "Image sucessfully thumb nailed!";
} else {
echo "File type not supported!";
}
?>