Php 图像JPEG创建黑色图像

Php 图像JPEG创建黑色图像,php,imagejpeg,Php,Imagejpeg,我知道这是一个老问题,但我不能解决它。这是我的密码 function add_ZK_mark($inputfile, $outputfile) { $im = @imagecreatefromjpeg($inputfile); $bg = @imagecolorallocate($im, 255, 255, 255); $textcolor = @imagecolorallocate($im, 0, 0, 255); list($x, $y, $type) = getimagesize($in

我知道这是一个老问题,但我不能解决它。这是我的密码

function add_ZK_mark($inputfile, $outputfile) {
$im = @imagecreatefromjpeg($inputfile);
$bg = @imagecolorallocate($im, 255, 255, 255);
$textcolor = @imagecolorallocate($im, 0, 0, 255);

list($x, $y, $type) = getimagesize($inputfile);
@imagejpeg($im, $outputfile);
@imagedestroy($im);

}
我每次都会得到jpeg图像类型。使用signature.js以jpeg格式获取图像。
谢谢

第一步:停止使用
@
。这相当于(孩子气地)把手指塞进耳朵,然后说“拉拉听不见你”。你知道你的代码有问题,但你告诉php“闭嘴,我不在乎”。你只是简单地假设一切都会完美地工作,失败永远不会发生。。。祝你好运。你哪里有问题?你不想要什么效果,你期望什么效果?IMHO你的代码准备了一个jpeg图像,从文件中读取,用于处理它,但我看不出它对这个图像有什么作用或应该有什么作用。它正在创建一个黑色图像。这就是问题所在。您使用的PHP版本是什么?我对PHPV5.3.3(Debian6)也有类似的问题,我怀疑这就是PHP发行版(gd.so)的问题。它是在更新到5.3.3.1-7+squeeze27之后出现的(squeeze28也有这个问题)。挤压26-没有这个:(
imagecreatefromjpeg()
使用
中断脚本警告:解析参数时类型说明符不正确
。另一个建议-文件系统权限。我使用的是PHP版本5.4.43。您能指导我如何解决此问题吗?