gpt4 book ai didi

php - 一些图像显示,一些图像不显示(Broken X)

转载 作者:行者123 更新时间:2023-12-05 04:20:20 25 4
gpt4 key购买 nike

一些图像显示和一些图像不显示(Broken X)代码在下面,而且我正在使用 xampp 5(mpdf)....

 if(!empty($row["google_address"])){
$address = $row["google_address"].'<br>'.'/'.'Lat - '.$row["latitude"].' / '.'Long - '.$row["longitude"];
}else{
$address ='';
}
$table .= '<tr>';
$table .= "<td>".$i++."</td>";
$table .= "<td>".$row["name"]."</td>";
$table .= "<td>".$row["mobile"]."</td>";
$table .= "<td>".$row["organization_name"]."</td>";
$table .= "<td>".$row["beatName"]."</td>";
$table .= "<td>".$row["customer_type"]."</td>";
$table .= "<td>".$i_Type."</td>";
$table .= "<td>".$row["intration_date"]."</td>";
$table .= "<td>".$row["next_activity_at"]."</td>";
$table .= "<td>".$row["call_time"]."</td>";
$table .= "<td>".$row["purpose"]."</td>";
$table .= "<td>".$row["status"]."</td>";
$table .= "<td>".$vIn."</td>";
$table .= "<td>".$vOut."</td>";
$table .= "<td>".$row["remark"]."</td>";
$table .= "<td>".$row["rating"]."</td>";
$table .= "<td>".str_replace('\' ', '\'', ucwords(str_replace('\'', '\' ', strtolower($row["fname"]))))."</td>";
$table .= "<td>".$address."</td>";

// $pathe = \Yii::getAlias('@web/uploads/crm_images/');
// $img = $row["visit_image"] ? ' <img src = "'.$pathe.$row["visit_image"].'" width ="200px" height = "200px">' : '';

// $img = $remark1[0]['image_one'] ? ' <img src = "https://timekompas.com/backend/web/uploads/task_photo/'.$remark1[0]['image_one'].'" width ="80px" height = "80px">' : '';
$img = $row["visit_image"] ? ' <img src = "https://timekompas.com/backend/web/uploads/crm_images/'.$row["visit_image"].'" width ="200" height = "200">' : '';
//echo $row["visit_image"];
//echo $img;
//die;
$table .="<td>".$img."</td>";

mpdf 代码 (Xampp 5) :-

 $path = \Yii::getAlias("@vendor/MPDF/mpdf.php");
require_once($path);
$mpdf = new \mPDF('en-GB-x', 'A4-L', '', '', 5, 5, 5, 5, 6, 3);
// $mpdf->curlAllowUnsafeSslRequests = true;
// $mpdf->showImageErrors = true;
// $mpdf->debug = true;
$mpdf->packTableData = true;
$mpdf->SetDisplayMode('fullpage');
$mpdf->SetFooter('Contact no: +91-771-4700067, 7772800067 Email ID: timekompas@entitcs.com');
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
// if($_SESSION["isSupAdmin"]=='1')
// {
// $mpdf->SetWatermarkText('TIME KOMPAS');
// }
// else
// {
// $mpdf->SetWatermarkText('TIME KOMPAS');
// $mpdf->SetWatermarkText($_SESSION["timecampus_officename"]);
if($_SESSION["ofc_new_com"] != '' && $_SESSION["ofc_new_name"] != ''){

$mpdf->SetWatermarkText($_SESSION["ofc_new_com"].'( '.$_SESSION["ofc_new_name"].' )');
}
if(($_SESSION['order_detail'] != '')||($_SESSION['taskreport_sql'] != '')){
$employee =\Yii::$app->session->get('empdata');
$office = Yii::$app->db->createCommand("select ofc_name,company_name from master_office where ofc_id = '".$employee['employee']['emp_ofcid']."' ")->queryOne();
$mpdf->SetWatermarkText($office["company_name"].'( '.$office["ofc_name"].' )');
}


//}
/* $table .=$_SESSION['khumesh_map']; */
//$mpdf->SetWatermarkText($_SESSION['ofc_new_com']);

$mpdf->showWatermarkText = true;
$mpdf->watermarkTextAlpha = 0.3;
$mpdf->simpleTables = true;
$mpdf->WriteHTML($table);
$mpdf->Output($filename . '.pdf', 'I');

exit;

问题图片(在我的图片中,一张图片显示,一张图片显示 x,而第二张图片是空白的,因为它是空的。)

enter image description here

我怎样才能解决那个问题来解决我的问题

最佳答案

该代码很好,但存在图像大小问题,图像大小超过 20 kb 这是一个原因

关于php - 一些图像显示,一些图像不显示(Broken X),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74532239/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com