PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : libpng error



][Schlumpf][
17.11.07, 21:42
Hallo Leute habe da ein kleines Problem. Ich habe mal ein neues Gästebuch Installiert. Was soweit ales wunderbar Funktioniert ausser eines nicht. Wenn man im GB einen Eintrag machen möchte. Wird mir die Grafik des Security Code nicht angezeigt.

GD ist aber soweit installiert

GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.2.1
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

Wenn ich die Seite aufrufe um einen Eintrag ins GB zu machen tauchen in meinen Logsdiese 2 Zeilen auf

gd-png error: setjmp returns error condition
gd-png: fatal libpng error: zlib error

Habe nun schon viel gegoogelt aber nicht wircklich was brauchbares finden können. Das System selber ist up to date. Weiß da evtl einer von euch rat ?

Hier mal das Script selber was die grafik anzeigen soll evtl hilft es einen


<?php
/*
+--------------------------------------------------------------------------
| Gbook MX v4.5.0
| ========================================
| (c) 2004 - 2006 Victor Simental
| Web: http://www.gbookmx.com
| ========================================
| > Wrapper script
| > Script written by Victor Simental
| > Date started: 03th November 2003
| ========================================
+--------------------------------------------------------------------------
| This program is free software. You can redistribute it and/or modify
| it under the terms of the GNU General Public License as published by
| the Free Software Foundation; either version 2 of the License.
| http://www.gbookmx.com/license/gpl-license.html
+---------------------------------------------------------------------------
*/

if(empty($_GET['ihash']))
{
header("location: gbook.php");
exit();
}
else
{

require_once("includes/encript.php");
$rand = htmlspecialchars(base64_decode(encrypt($_GET['ihash'],1)));


if(function_exists('imagettftext'))
$image = imagecreatefrompng("images/code.png");
else
$image = imagecreatefrompng("images/codeb.png");

$numero = rand(1,6);//Ramdomize colors

//Change The font name
$font = "images/CITID___.TTF";


switch ($numero)
{
case 1:
$azul = imagecolorallocate($image,255,0,0);
break;

case 2:
$azul = imagecolorallocate($image,0,0,255);
break;

case 3:
$azul = imagecolorallocate($image,153,0,0);
break;

case 4:
$azul = imagecolorallocate($image,0,0,0);
break;

case 5:
$azul = imagecolorallocate($image,18,78,72);
break;

case 6:
$azul = imagecolorallocate($image,78,90,144);
break;
}

if(function_exists('imagettftext'))
$text_color = imagettftext($image,25, 15, 14, 53,$azul, $font,$rand);
else
ImageString ($image, 10, 12, 8, $rand, $azul);

Header("Content-type: image/png");
imagepng($image, '', 100);
ImageDestroy($image);
}

?>

pcb
17.11.07, 22:43
Das Problem liegt bei der Funktion imagepng. Es sieht so aus, als wuerde ihr ein ungueltiger Parameter uebergeben. Tausche sie durch folgendes aus:


imagepng($image, NULL, 9, PNG_NO_FILTER);

Bedenke, dass das Kompressionslevel fuer PNGs nur von 0 bis 9 betragen kann.

][Schlumpf][
17.11.07, 23:00
Danke habe es mal geändert. nun ist eine Grafik da aber der Grafik Inhalt ist immer gleich da steht nun die ganze Zeit [][][][][]

Sehe hier http://www.dead-or-live.de/v2/gb/gbook.php?op=Add_Sign

pcb
17.11.07, 23:16
Tausche


if(function_exists('imagettftext'))
$text_color = imagettftext($image,25, 15, 14, 53,$azul, $font,$rand);
else
ImageString ($image, 10, 12, 8, $rand, $azul);

durch


ImageString ($image, 1, 12, 8, $rand, $azul);

aus. Das zweite Argument darf eine Zahl zwischen 1 und 5 sein, wobei 1 die kleinste Schriftgroesze darstellt.

][Schlumpf][
17.11.07, 23:27
Super, alern besten Dank nun gehts. Danke noch mal :)