簡體   English   中英

imagejpeg不顯示圖像

[英]imagejpeg do not show an a image

我正在嘗試生成要打印的證書,但是唯一發生的是在屏幕上顯示一個空的正方形:

在此處輸入圖片說明

我嘗試在屏幕上顯示圖像之前嘗試在其上書寫。

header("Content-type: image/jpeg");
$imagem = imagecreatefromjpeg("assets/img/certificado.jpg");
imagejpeg($imagem);

我已經檢查了gd2擴展名並啟用了它: 在此處輸入圖片說明

而且我檢查了php錯誤日志,運行此代碼的頁面未返回任何錯誤。

當我刪除header("Content-type:image/jpeg"); 並放一個var_dump($i)它告訴我: resource(12,gd)

對不起,我的英語,謝謝!

$our_image = imagecreatefromjpeg('upload/promo/flyer_hindi.jpg');
$white_color = imagecolorallocate($our_image, 0, 0, 0);
$font_path = 'upload/promo/CALIBRIB.TTF';
$text = 'some text';
$size = 70;
$angle = 0;
$left = 420;
enter code here
imagettftext($our_image, $size, $angle, $left, $top, $white_color, $font_path, $text);
imagejpeg($our_image, 'upload/promo/' . $id . '.jpg', 80);

去年,我嘗試了此代碼,我上傳了傳單,並在修復位置添加了一些文字並保存。 我認為你需要同樣的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM