下面是我的图像生成代码:
$thumb = imagecreatetruecolor($newwidth, $newheight) or die('Cannot Initialize new GD image stream');
print_r($thumb);
$source = imagecreatefrompng($filename) or die('Cannot Initialize new GD image stream');
print_r($source);
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
@imagepng( $thumb, $original_img_dir_absolute_path.$original_img_name, 0 );
它将生成第一个 png,但只有黑色背景。任何人都知道它。