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