图片 "path" 无法显示,因为它包含错误

The image "path" cannot be displayed because it contains errors

drupal 站点使用 imagecreatefromjpegimagejpeg 创建图像时产生以下错误:

The image “http://domain.com/dbtransfer” cannot be displayed because it contains errors.

我启用了错误显示并检查了错误日志,但没有显示任何错误。没有任何消息显示。所有的路径都是正确的,所有的变量也是正确的。

正在创建数据并将数据写入 mpdf 图像,但它在此处不起作用。

$img=imagecreatefromjpeg(DRUPAL_ROOT . '/sites/all/themes/journalcrunch/images/pdfbg.jpg');       
$image_text="Publisher:";
$image_text1="$publisherpdf";
$image_text2="Pricing:";
$image_text3="Single User License:";
$image_text4="US $ $sulpdf";
$image_text5="Corporate User License:";
$image_text6="US $ $culpdf";
$image_text7="Category:";
$image_text8="$categoriespdf";
$image_text9="No. of Pages: $pagespdf";
$red=rand(100,30); 
$green=rand(100,60);
$blue=rand(100,95);
$text_color=imagecolorallocate($img,30,60,95);
$text=imagettftext($img,9,0,25,145,$text_color,"fonts/arialbd.ttf",$image_text);
$text=imagettftext($img,10,0,25,170,$text_color,"fonts/arialbd.ttf",$image_text1);
$text=imagettftext($img,10,0,25,215,$text_color,"fonts/arialbd.ttf",$image_text2);
$text=imagettftext($img,9,0,25,235,$text_color,"fonts/arialbd.ttf",$image_text3);
$text=imagettftext($img,9,0,25,255,$text_color,"fonts/arialbd.ttf",$image_text4);
$text=imagettftext($img,9,0,25,275,$text_color,"fonts/arialbd.ttf",$image_text5);
$text=imagettftext($img,9,0,25,295,$text_color,"fonts/arialbd.ttf",$image_text6);
$text=imagettftext($img,9,0,25,340,$text_color,"fonts/arialbd.ttf",$image_text7);
$text=imagettftext($img,10,0,25,365,$text_color,"fonts/arialbd.ttf",$image_text8);
$text=imagettftext($img,10,0,25,410,$text_color,"fonts/arialbd.ttf",$image_text9);

header("Content-type:image/jpeg");
header("Content-Disposition:inline ; filename=secure.jpg"); 
imagejpeg($img,"images/".$lastnid.".jpg",100);

我编辑了图像文件,发现其中有错误。现已修复。