[英]unable to display an image in php
在我的項目中,我將圖像的json輸入並像這樣將其轉換為png。
$json = $_POST['output'];
$img = sigJsonToImage($json);//convert json to image
imagepng($img, 'signimage.png');//it saves the image correctly in local folder
但是當我想通過代碼在瀏覽器上顯示它時
header('Content-Type: image/png');
imagepng($img);
它給出了圖像包含錯誤並且無法顯示的錯誤。
請幫助我找出這個問題謝謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.