Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php gd库提供断开的图像并覆盖wordpress主题_Php_Wordpress_Gd - Fatal编程技术网

Php gd库提供断开的图像并覆盖wordpress主题

Php gd库提供断开的图像并覆盖wordpress主题,php,wordpress,gd,Php,Wordpress,Gd,我创建了一个新模板,并添加了以下代码: <?php $stamp = imagecreatefrompng('images/haz.png'); $im = imagecreatefromjpeg('images/baz.jpg'); $marge_right = 10; $marge_bottom = 10; $sx = imagesx($stamp); $sy = imagesy($stamp); imagecopy($im, $stamp, imagesx($im) - $sx

我创建了一个新模板,并添加了以下代码:

<?php
$stamp = imagecreatefrompng('images/haz.png');
$im = imagecreatefromjpeg('images/baz.jpg');

$marge_right = 10;
$marge_bottom = 10;
$sx = imagesx($stamp);
$sy = imagesy($stamp);

imagecopy($im, $stamp, imagesx($im) - $sx - $marge_right, imagesy($im) - $sy - $marge_bottom, 0, 0, imagesx($stamp), imagesy($stamp));

header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>

更让我烦恼的是,它不仅显示了一个破碎的图像,还覆盖了我的整个主题!我已经在谷歌上寻找了几个小时的解决方案,但似乎找不到

GD库将出现致命错误,可能会死亡/退出。

删除
标题
调用,右键单击损坏的图像并选择“查看图像”。您的图像不会显示,因为输出缓冲区中可能写入了PHP错误消息。
GD Support  enabled
GD Version  bundled (2.0.34 compatible)
FreeType Support    enabled
FreeType Linkage    with freetype
FreeType Version    2.3.11
GIF Read Support    enabled
GIF Create Support  enabled
JPG Support enabled
PNG Support enabled
WBMP Support    enabled
XPM Support enabled
XBM Support enabled