我正在尝试使用以下PHP代码加载在 wp-content 文件夹中上传的图像:
header ('content-type:image/jpeg');
$font=realpath(‘arialbd.TTF’);
$image=imagecreatefromjpeg("Certificate.jpg");
$color=imagecolorallocate($image,19,21,22);
$name="Text Name";
imagettftext($image, 40, 0, 230, 400, $color, $font, $name);
imagejpeg($image);
imagedestroy($image);
加载页面时,我只能看到垃圾(很多未知字符)。
请帮帮我,谢谢。