douhuzhi0907 2016-02-19 14:41
浏览 359

imagepng没有显示应该显示的内容

So i was working on signature system, and last night it worked, it displayed image, but i went to sleep, turned off my pc, and when i got back on i figured out that it has stopped working, it started displaying this image, which was displayed last night but i got it working somehow, i don't know how to be honest.

This is what i get:

WHEN I TRY TO GET IMAGE: http://i.imgur.com/A96dYZp.jpg PHPINFO: http://i.imgur.com/AjFJ3VF.jpg

CODE:

<?php

if (file_exists(dirname(__FILE__) . '/SSI.php')) {
require(dirname(__FILE__) . '/SSI.php');
}
else die("GRESKA: SSI.php nije pronaden!");


error_reporting(E_ALL);
$username="root"; // KORSINICKO IME
$password=""; // ŠIFRA
$database="smf"; // BAZA
$host="localhost"; // HOST

$con = mysqli_connect($host,$username,$password,$database) or die( "GRESKA: Dogodila se greska pri povezivanju na bazu podataka!");

if(isset($_GET['id'])) $korisnikov_id = $_GET['id']; // DOBAVLJA KORISNIKOV ID
else if(isset($_POST['id'])) $korisnikov_id = $_POST['id'];

$korisnikov_id = mysqli_real_escape_string($con, $korisnikov_id); 

if(isset($_GET['stil'])) $stil = $_GET['stil']; // DOBAVLJA STIL POTPISA
else if(isset($_POST['stil'])) $stil = $_POST['stil'];

$stil = mysqli_real_escape_string($con, $stil);

if($stil == 1 ) // STIL I
{ 

$query = "SELECT * FROM `smf_members` WHERE `id_member` = '$korisnikov_id' LIMIT 1"; // VADI PODATKE IZ KOJE TABELE?

$rezultat = mysqli_query($con, $query) or die(mysqli_error());

if(mysqli_num_rows($rezultat) == "0") die("GRESKA: Taj korisnicki ID ne postoji u bazi."); // ID JE 0 ILI JOS NIJE REGISTROVAN???

$row = mysqli_fetch_assoc($rezultat);

$ime = $row['real_name']; // KORISNIKOVO TRENUTNO IME
$postovi = $row['posts']; // POSTOVI
$grupe = $row['id_group']; // GRUPA  
$spol = $row['gender']; // SPOL
$email = $row['email_address']; // KORISNIKOV EMAIL
$vreme = $row['total_time_logged_in']; // VREME PROVEDENO NA FORUMU

    // KONVERTER VREMENA
    function secondsToWords($vreme)
    {
        $days=(int)($vreme/86400);
        $hours = (int)(($vreme-($days*86400))/3600);
        $mins = (int)(($vreme-$days*86400-$hours*3600)/60);
        return sprintf("%dd %dh %dm", $days, $hours, $mins);
    }

if($spol == 1) $spoltext = "Musko";
if($spol == 2) $spoltext = "Zensko";
if($spol == 0) $spoltext = "Nepoznato";

// DOBAVLJAMO STVARI DIREKTNO SA PROFILA

global $context, $settings, $modSettings, $db_prefix, $boardurl;

 loadMemberData(array($korisnikov_id), false, 'profile');
 loadMemberContext($korisnikov_id);

  $context['status'] = $memberContext[$korisnikov_id]['online']['text']; // ONLINE/OFFLINE STATUS
  $context['avatar'] = $memberContext[$korisnikov_id]['avatar']['href']; // AVATAR

header("Content-type: image/jpeg,image/gif,image/png"); // PRETVARA STRANICU U SLIKU

$Potpisi = @imagecreatefrompng("cover_1.png"); // LOKACIJA SLIKE

$BOJA_BELA = imagecolorallocate($Potpisi, 255, 255, 255);
$BOJA_CRVENA = imagecolorallocate($Potpisi, 255, 0, 0);
$BOJA_PURPLE = imagecolorallocate($Potpisi, 128,0,128);

$FONT = "./Fontovi/BebasNeue.otf"; // FONT

$ADMINISTRATOR = 'Administrator'; // RANKOVI
$SMOD = 'Super Moderator'; // RANKOVI
$CLAN = 'Clan';

if($grupe == 1) // GRUPE
{
    imagettftext($Potpisi, 21, 0, 115, 50, $BOJA_BELA, $FONT, $ime); // VELIKO IME
    imagettftext($Potpisi, 17, 0, 115, 90, $BOJA_CRVENA, $FONT, $ADMINISTRATOR); // ADMINISTRATOR
}
else if($grupe == 2) // GRUPE
{
    imagettftext($Potpisi, 21, 0, 115, 50, $BOJA_BELA, $FONT, $ime); // VELIKO IME
    imagettftext($Potpisi, 17, 0, 115, 90, $BOJA_PURPLE, $FONT, $SMOD); // ADMINISTRATOR
}
else
{
    imagettftext($Potpisi, 21, 0, 115, 50, $BOJA_BELA, $FONT, $ime); // VELIKO IME
    imagettftext($Potpisi, 17, 0, 115, 90, $BOJA_BELA, $FONT, $CLAN); // CLAN
}

imagettftext($Potpisi, 13, 0, 75, 194, $BOJA_BELA, $FONT, $postovi); // POSTOVI
imagettftext($Potpisi, 13, 0, 210, 194, $BOJA_BELA, $FONT, secondsToWords($vreme)); // VREME PROVEDENO ONLINE
imagettftext($Potpisi, 13, 0, 354, 194, $BOJA_BELA, $FONT, $spoltext); // SPOL
imagettftext($Potpisi, 17, 0, 115, 70, $BOJA_BELA, $FONT, $email); // EMAIL
imagettftext($Potpisi, 17, 0, 115, 110, $BOJA_BELA, $FONT, $context['status']); // ONLINE/OFFLINE INDIKATOR

// DOBAVLJAČ AVATARA SA PROFILA KORISNIKA TE KONVERTER SLIKE
if (exif_imagetype($context['avatar']) == IMAGETYPE_GIF)
$traziavatar = imagecreatefromgif($context['avatar']);

if (exif_imagetype($context['avatar']) == IMAGETYPE_PNG)
    $traziavatar = imagecreatefrompng($context['avatar']);

if (exif_imagetype($context['avatar']) == IMAGETYPE_JPEG)
    $traziavatar = imagecreatefromjpeg($context['avatar']);

list($width, $height) = getimagesize($context['avatar']); // KONVERTOVANJE AVATARA

$context['avatar'] = imagecreatetruecolor(512, 512);
imagecopyresampled($Potpisi, $traziavatar, 16.5, 25, 0, 0, 92, 92, $width, $height);  // PRIKAZ AVATARA

ImagePng($Potpisi);
ImageDestroy($Potpisi);

}
else 
{ 
    die("GRESKA: Taj stil ne postoji u bazi podataka! Pronadjeni stilovi (1) , (2)"); 
}

?>

My logs contain the following:

[Fri Feb 19 15:52:12.629932 2016] [ssl:warn] [pid 5848:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:12.699932 2016] [core:warn] [pid 5848:tid 248] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Feb 19 15:52:12.859932 2016] [ssl:warn] [pid 5848:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:12.899932 2016] [mpm_winnt:notice] [pid 5848:tid 248] AH00455: Apache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.15 configured -- resuming normal operations
[Fri Feb 19 15:52:12.899932 2016] [mpm_winnt:notice] [pid 5848:tid 248] AH00456: Apache Lounge VC11 Server built: Oct 13 2015 10:54:13
[Fri Feb 19 15:52:12.899932 2016] [core:notice] [pid 5848:tid 248] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Fri Feb 19 15:52:12.909932 2016] [mpm_winnt:notice] [pid 5848:tid 248] AH00418: Parent: Created child process 2576
[Fri Feb 19 15:52:13.449940 2016] [ssl:warn] [pid 2576:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:13.791941 2016] [ssl:warn] [pid 2576:tid 260] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Feb 19 15:52:13.831941 2016] [mpm_winnt:notice] [pid 2576:tid 260] AH00354: Child: Starting 150 worker threads.
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大