$src_height) { $th_width=$cfg['longestSide']; $th_height=$src_height*($th_width/$src_width); } else { $th_height=$cfg['longestSide']; $th_width=$src_width*($th_height/$src_height); } if (chkgd2()) { $id=imagecreatetruecolor($th_width,$th_height); imagecopyresampled($id,$src_img,0,0,0,0,$th_width,$th_height,$src_width,$src_height); } else { $id=imagecreate($th_width,$th_height); imagecopyresized($id,$src_img,0,0,0,0,$th_width,$th_height,$src_width,$src_height); } imagejpeg($id); imagedestroy($src_img); imagedestroy($id); ?>