0
我在使用我的imagejpeg()
函数保存图像时遇到了错误。 用imagejpeg保存图像
$tempFile = 'temp/'.$fbme['id'].'.jpg'; imagejpeg($cardImg,$tempFile,90); saveTrackingRecord($fbme['id'], $randomPicIdx);
这是错误:
Warning: imagejpeg() expects parameter 1 to be resource, boolean given
请帮助。提前谢谢你。
更新
下面是我最初定义$tempfile
。
$tempFile = 'temp/'.$fbme['id'].'.jpg?time='.time();
下面是我给O/P:
<img src="<?php echo $tempFile.'?time='.time(); ?>" style="width:90%; max-width:400px;"/></center><br/>
什么是'$ cardImg'之前创建与imagetruecolor的形象呢?它应该是资源,而不是布尔值。 – panther
添加你定义'$ cardImg'的代码 –
或许'$ tempFile'不存在 – ashkufaraz