<?PHP $src = ImageCreateFromJPEG('php.jpg'); $width = ImageSx($src); $height = ImageSy($src); $x = $widht/2; $y = $height/2; $dst = ImageCreateTrueColor($x,$y); ImageCopyResampled($dst,$src,0,0,0,0,$x,$y,$widht,$height); header('Content-Type : image/png'); ImagePNG($det); ?>