dont know, but this function should work for you:
function resize($start_path,$end_path,$end_size,$type)
{
$picture_location = "$start_path";
$picture_save = "$end_path";
$size = $end_size; // size in pixel you want the picture to come out height or width - whichever is bigger
$im_size = GetImageSize ( $picture_location);
$imageWidth = $im_size[0];
$imageHeight = $im_size[1];
// - or with GD 2+ -
// do all your color allocations here
//$font_color_black = ImageColorAllocate( $im, 0,0,0);
if ($type == JPEG){
$im2 = ImageCreateFromJPEG($picture_location);
}
if ($type == PNG){
$im2 = ImageCreateFromPNG($picture_location);
}
if ($imageWidth>=$imageHeight)
{
$width=$size;
$height = ($width/$imageWidth)*$imageHeight;
}
else
{
$height=$size;
$width = ($height/$imageHeight)*$imageWidth;
}
$im = imageCreateTrueColor( $width, $height );
ImageCopyResized ($im,$im2, 0, 0, 0, 0, $width, $height, $imageWidth, $imageHeight);
//Imagejpeg($im,'',100); to print to screen
if ($type == JPEG){
Header("Content-type: image/jpeg");
ImageJPEG($im,$picture_save,80);
}
if ($type == PNG){
Header("Content-type: image/png");
ImagePNG($im,$picture_save,80);
}
ImageDestroy($im);
ImageDestroy ($im2);
}
if ($fupload_type == "image/x-png"){
resize("$file_dir/$uploaded_img","$file_dir/thumb/$thumbnail_name","100","PNG");
resize("$file_dir/$uploaded_img","$file_dir/$full_size_img_name","450","PNG");
}
if ($fupload_type == "image/pjpeg"){
resize("$file_dir/$uploaded_img","$file_dir/thumb/$full_size_img_name","100","JPEG");
resize("$file_dir/$uploaded_img","$file_dir/$full_size_img_name","450","JPEG");
}
Unfortunately you cannot use gif's but thats rare for people to upload anyways.
hope this helps...