bir security kodu dosyası hatası serverda imagemagic yüklü. ama nedense bu hatayı verior.
Fatal error: Call to undefined function: imagettfbbox() in /home/oyun/public_html/imageclick.php on line 221
221 i satırda resmin üzerinde ne yazıcağı ve boyutları belirtilmiş
$tmp = imagettfbbox ($i, 0, $font, $text);
dosyanın içeriği bu. ben çözemedim nedir sorun. serverda gd-imagemagic-zend yüklü.
Fatal error: Call to undefined function: imagettfbbox() in /home/oyun/public_html/imageclick.php on line 221
221 i satırda resmin üzerinde ne yazıcağı ve boyutları belirtilmiş
$tmp = imagettfbbox ($i, 0, $font, $text);
PHP:
<?php
//include "vsys.php";
//include "gifmerge.php";
$tmp_save_prefix="";
$anim_size["h"]=50;
$anim_size["w"]=350;
/*if ($cgi["first_image2"]) {
$fname= "fronts/".$cgi['first_image2'];
$fname_real=$cgi['first_image2'];
}else{
//$fname= $_FILES['first_image']['tmp_name'];
$fname_real= $_FILES['first_image']['name'];
//$fname="tmp/".time()."_".$fname_real;
$fname=time()."_".$fname_real;
move_uploaded_file($_FILES['first_image']['tmp_name'], $fname);
}
if ($cgi["second_image2"]){
$fname2= "backs/".$cgi['second_image2'];
$fname2_real=$cgi['second_image2'];
}else{
$fname2_real= $_FILES['second_image']['name'];
//$fname2="tmp/".time()."_".$fname2_real;
$fname2=time()."_".$fname2_real;
move_uploaded_file($_FILES['second_image']['tmp_name'], $fname2);
//$fname2= $_FILES['second_image']['tmp_name'];
}
*/
//if (!$fname){vMessage("You should choose first image.");exit;}
//if (!$fname2){vMessage("You should choose second image.");exit;}
//$cgi['first_delay']=100;
//if (!$cgi['first_delay']){vMessage("You should choose delay for the first image.");exit;}
//if (!$cgi['second_delay']){vMessage("You should choose delay for the second image.");exit;}
session_start();
if ($_SESSION['number1']){
$txt=$_SESSION['number1'];
}else{
switch ($_SESSION['number']){
case 1: $num='B-i-R';break;
case 2: $num='i-K-i';break;
case 3: $num='U-C';break;
case 4: $num='D-O-R-T';break;
case 5: $num='B-E-S';break;
case 6: $num='A-L-T-I';break;
case 7: $num='Y-E-D-i';break;
case 8: $num='S-E-K-i-Z';break;
case 9: $num='D-O-K-U-Z';break;
case 10: $num='O-N';break;
case 11: $num='O-N-B-i-R';break;
case 12: $num='O-N-i-K-i';break;
case 13: $num='O-N-U-C';break;
case 14: $num='O-N-D-O-R-T';break;
case 15: $num='O-N-B-E-S';break;
default: $num=$_SESSION['number'];
}
//$num='o-n-e';
$first=chr(rand(0x21,0x40));
$last=chr(rand(0x21,0x40));
$txt=$first.'-'.$num.'-'.$last;
}
vMakeImg($txt);
//vMakeImg($fname2,$fname2_real,"second");
//vMakeAnimGif();
exit;
function vMakeImg($n){
global $anim_size;
$img=imagecreatetruecolor($anim_size["w"],$anim_size["h"]);
$iconf['bgcolor']='00,00,255'; //$cgi[$n.'_backcolor'];
$iconf['font']='fonts/arialbd.ttf';
$iconf['text1']=$n;
//$iconf['text2']=$cgi[$n.'_text2'];
//$iconf['text3']=$cgi[$n.'_text3'];
$iconf['textcolor']='255,255,255';//$cgi[$n.'_textcolor'];
$iconf['textsize']=27;//$cgi[$n.'_size'];
//if ($iconf['font'])
vText($img,$iconf['font'],$iconf['text1'],$iconf['text2'],$iconf['text3'],$iconf['textcolor'],$anim_size["h"],$anim_size["w"],$iconf['textsize']);
//while (imagecolorstotal($img)<256){
//imagecolorallocate ($img,0,0,0);
//}
//Ending
//$tmp_save_file=($tmp_save_prefix)?$tmp_save_prefix:"tmp/".time()."_".rand(100,999);
//$tmp_save_file=($tmp_save_prefix)?$tmp_save_prefix:time()."_".rand(100,999);
//if (!$tmp_save_prefix)$tmp_save_prefix=$tmp_save_file;
//$tmp_save_file.="_$n.gif";
//********************************************************************************Uncoment
//echo $cgi['path'].$tmp_save_file."==";
//imagegif ($img,$cgi['path'].$tmp_save_file);
//imagegif ($img,$tmp_save_file);
//********************************************************************************Comment
//imagegif ($img,$n.".gif");
//echo $tmp_save_file."111";
//echo "hi";
//imagepng ($img);
imagejpeg($img);
//imagepng ($img,$n.".png");
}
function vMakeAnimGif(){
global $cgi,$tmp_save_prefix;
$animPath=$tmp_save_prefix."_all.gif";
$filePath1=$tmp_save_prefix."_first.gif";
$filePath2=$tmp_save_prefix."_second.gif";
$inFiles[0]=$filePath1;
$inFiles[1]=$filePath2;
//echo "doing....<br>";
//vMergeToGif("out.gif",$inFiles,20,99999,2);
vMergeToGif($animPath,$inFiles,$cgi['first_delay'],99999);//,-1,$cgi['first_delay']);
//echo "done.";
//$str="whirlgif -o $animPath -loop -time {$cgi['first_delay']} $filePath1 -time {$cgi['second_delay']} $filePath2";
//echo $str;
//system($str);
//********************************************************************************Uncomment
//unlink($filePath1);
//********************************************************************************Uncomment
//unlink($filePath2);
//********************************************************************************Uncomment
//echo "<script>document.location='{$animPath}';</script><a href='{$animPath}'>download</a>";
//aim:BuddyIcon?src=http://dollisland.com imagename.gif
//echo "--";
echo "<table width=100% height=100% ><tr><td valign=middle align=center><a href=aim:BuddyIcon?src=http://dollisland.com/gif/$animPath ><img src='$animPath' border=0></a></td></tr></table>";
//echo "++";
vTrash();
}
function LoadJpeg ($imgname,$imgtype) {
//echo $imgtype."--";
if ($imgtype==2){
$im = @imagecreatefromjpeg ($imgname);// Attempt to open
}elseif($imgtype==1){
$im = @imagecreatefromgif ($imgname);// Attempt to open
}elseif($imgtype==3){
$im = @imagecreatefrompng ($imgname);// Attempt to open
}elseif($imgtype==4){
echo $imgname;
$im = @imagecreatefromwbmp ($imgname);// Attempt to open
}
else{ $imgtype=2;}
if (!$im) { // See if it failed
//$im = imagecreatetruecolor (150, 30); // Create a blank image
$im = imagecreate (150, 30); // Create a blank image
$bgc = imagecolorallocate ($im, 255, 255, 255);
$tc = imagecolorallocate ($im, 0, 0, 0);
imagefilledrectangle ($im, 0, 0, 150, 30, $bgc);
// Output an errmsg
imagestring ($im, 1, 5, 5, "Error loading $imgname", $tc);
}
return $im;
}
function vMessage($str){
echo "<table height=100% width=100%><tr><td align=center valign=middle>$str";
}
function vBasename ($str){
$strA=split("[\]",$str);
$str1=$strA[count($strA)-1];
$strA=split("[/]",$str1);
$str1=$strA[count($strA)-1];
return $str1;
}
function vExtType($str){
$tnameA=split("\.",$str);
$t_ext=$tnameA[count ($tnameA)-1];
$t_ext=strtolower($t_ext);
if ($t_ext=="gif"){$imgtype=1;}
elseif (($t_ext=="jpg")||($t_ext=="jpeg")){$imgtype=2;}
elseif ($t_ext=="png"){$imgtype=3;}
elseif ($t_ext=="bmp"){$imgtype=4;}
else {$imgtype=0;}
//echo $imgtype."#;#";
return $imgtype;
}
function vTrash(){
global $cgi;
if ($dir = @opendir($cgi['path'])) {
while (($file = readdir($dir)) !== false) {
if ( ($file!='.')&&($file!='..')){
//echo $file;
$tnameA=split("_",$file);
if (count ($tnameA)>1){
$time1=$tnameA[0];
$time2=time();
if (($time2-$time1)>180)unlink($file);
}
}
}
closedir($dir);
}
exit;
}
function getTXTSize($font,$text,$koef,$max_height,$width){
$TXT['prev_size']=0;
$TXT['prev_width']=0;
for ($i=3;$i<=$max_height*$koef;$i++){
$tmp = imagettfbbox ($i, 0, $font, $text);
$TXT['size']=$i;
$TXT['width']=$tmp[2]-$tmp[0];
if ($TXT['width']>$width*$koef){
$TXT['width']=$TXT['prev_width'];
$TXT['size']=$TXT['prev_size'];
break;
}
$TXT['prev_width']=$TXT['width'];
$TXT['prev_size']=$TXT['size'];
}
return $TXT;
}
function vText(&$img,$font,$text1,$text2,$text3,$textcolor,$h,$w,$size){
$koef=1;
$max_height=$size;
//echo "--$max_height--";
$colorA=split(",",$textcolor);
//print_r ($colorA);
$color=imagecolorclosest ($img, $colorA[0], $colorA[1], $colorA[2]);
//$color=imagecolorexact ($img, $colorA[0], $colorA[1], $colorA[2]);
if ($color=-1){
//echo "Allocating";
$color=imagecolorallocate ($img, $colorA[0], $colorA[1], $colorA[2]);
}
//$color=imagecolorclosest ($img, 255, 255, 255);
$TXTsize1=getTXTSize($font,$text1,$koef,$max_height,$w-10);
$TXTsize2=getTXTSize($font,$text2,$koef,$max_height,$w-10);
$TXTsize3=getTXTSize($font,$text3,$koef,$max_height,$w-10);
$x1=round(($w*$koef-$TXTsize1[width])/2);
$x2=round(($w*$koef-$TXTsize2[width])/2);
$x3=round(($w*$koef-$TXTsize3[width])/2);
$y1=$TXTsize1['size']*$koef+5;
$y2=$y1+$TXTsize2['size']*$koef+5;
$y3=$y2+$TXTsize3['size']*$koef+5;
//echo "text1=$text1.x1=$x1.y1=$y1.color=$color.font=$font";
imagettftext ($img,$TXTsize1['size'],0,$x1, $y1, $color, $font, $text1);
imagettftext ($img,$TXTsize1['size'],0,$x2, $y2, $color, $font, $text2);
imagettftext ($img,$TXTsize1['size'],0,$x3, $y3, $color, $font, $text3);
}
function vText2(&$dst_img,$src_img,$font,$text,$koef,$max_height,$width,$X,$Y,$Angle,$Color){
$fontfile=$font;
$conf['HeadLine_Color']=split(",",$Color);
$headTextColor=imagecolorallocate ($dst_img, $conf['HeadLine_Color'][0], $conf['HeadLine_Color'][1], $conf['HeadLine_Color'][2]);
if ($Angle){$padding=$Y;}
else{$padding=$X;}
$TXTsize=getTXTSize($fontfile,$text,$koef,$max_height,$width-$padding);
if ($Angle){
$start_txt_x=round(($width*$koef+$TXTsize[width])/2);//+$padding*$koef;//-$conf['HeadLine_X']*$conf['CoverImage_Quality'];
}else{
$start_txt_x=round(($width*$koef-$TXTsize[width])/2);//+$padding*$koef;//-$conf['HeadLine_X']*$conf['CoverImage_Quality'];
}
if ($Angle){
$y=$start_txt_x;
$x=$X*$koef;
}else{
$x=$start_txt_x;
$y=$Y*$koef;
}
imagettftext ($dst_img,$TXTsize[size],$Angle,$x, $y, $headTextColor, $fontfile, $text);
}
?>
dosyanın içeriği bu. ben çözemedim nedir sorun. serverda gd-imagemagic-zend yüklü.