我想要做的是拍摄 2 张图像并将它们组合起来以输出单个图像。当我尝试运行我的脚本时,我得到一个损坏的图像图标,没有别的。
<?php
header( "Content-type: image/png" );
$img1 = imagecreatefromjpeg('http://www.refaim.com/images/maleCharacter.jpg');
$img3 = imagecreatefrompng('http://www.refaim.com/images/leafswordleft.png');
$x1 = imagesx($img1);
$y1 = imagesy($img1);
$x2 = imagesx($img3);
$y2 = imagesy($img3);
imagecopyresampled(
$img1, $img3,
7, 135, 0, 0,
50, 50,
$x2, $y2);
imagepng($img1);
?>
我已经尝试了关于其他主题的所有其他建议,但都没有奏效。此外,如果我尝试在标签中调用文件,我仍然会得到损坏的图像。