0) $twidth=$pwidth; $theight = $twidth * $height / $width; # calculate height if($pheight>0) { $theight=$pheight; $twidth = $theight * $width / $height; //$theight = $twidth * $height / $width; # calculate height } $thumb = ImageCreatetruecolor ($twidth, $theight) or die ("Can't create Image!"); ImageCopyResampled($thumb, $pic, 0, 0, 0, 0, $twidth, $theight, $width, $height); # resize image into thumb ImageCopyResampled ImageCopyResized //ImageJPEG($thumb,"",75); # Thumbnail as JPEG //imagegammacorrect ($thumb, 1.0, 1.4 ) ; ImageJPEG($thumb,NULL,95); # Thumbnail as JPEG } ?>