【发布时间】:2023-02-10 05:24:06
【问题描述】:
成功完成课程后,我们的在线 LMS 会提供证书。这已经工作了多年。现在,出乎意料的是,我收到“由于错误,无法显示图像”。我无法在我的开发计算机上重现它。我的主机服务器运行的是 PHP 7.1.33;阿帕奇; Linux操作系统。我刷新浏览器窗口两三次,它终于显示出来了。
下面是代码。它采用空白证书的 png 图像并添加个人和班级的相关信息。我认为这不是代码问题,但我还是将其包括在内,尽管我删除了大部分覆盖代码,因为它与问题无关。
任何关于嘿正在发生的事情的见解将不胜感激。
<?php
include("../../_includes/path.php");
include("../../_includes/dbconn.php");
include("stauthorization.php");
ob_clean();
// Set the content-type
header('Content-Type: image/png');
// Create the image
$im = imagecreatefrompng($xpath1 . "/account_center/distributor/piccexcellence_cert_1.png");
$angle = 90;
$rotated = imagerotate($im, $angle, 0);
imagepng($rotated);
imagedestroy($im);
?>
【问题讨论】:
-
根本没有错误处理。