imagettftext function missing

Status
Not open for further replies.

cetutnx1

New Member
Messages
510
Reaction score
0
Points
0
I'm doing a visit counter and when i tried to see the page, i can't see the image.
Can anyone helpme!!!!

Thanks
 

simpss

New Member
Messages
4
Reaction score
0
Points
0
maybe the code is wrong?
could you give us the code so we could try out?
 
Last edited:

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
The true type library is gone again!?!?!? Ahh I'll attttttempt to talk to Richard.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Installed. Try now?

Thank you RRRRichard. :)
 

cetutnx1

New Member
Messages
510
Reaction score
0
Points
0
i've tryed out agian and didn't work, i'll pm the code to NedreN and post it here...
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
What is the error your getting? Are you getting an error?
 

cetutnx1

New Member
Messages
510
Reaction score
0
Points
0
i have made some changes to the original code but as of it is right here it works on mi local webserver (apache+php4.4.0 in windows)


<?php
//counter.php > Source
################################################
# SIXAL - ImageCounter v1.0 build 03/11/2005
# info@6al.net
################################################
# ONLINE SAMPLE PREVIEW :
# http://www.6al.net/
################################################
# Do not Edit
################################################

$count = $_GET['count'];

include("counter_config.php");

$des = imagecreate($counter_width,$counter_font_size);

$bgcol = HEX2RGB($counter_background);
$tcol = HEX2RGB($counter_color);
$bg = imagecolorallocate($des,$bgcol[0],$bgcol[1],$bgcol[2]);
$fc = imagecolorallocate($des,$tcol[0],$tcol[1],$tcol[2]);
imagecolortransparent($des,$bg);
$font = "../fonts/$counter_font.ttf";
$tt = $counter_numbers - strlen($count)-1;
$ts = 0;
while($ts <= $tt)
{
$count = '0'.$count;
$ts++;
}
imagettftext($des, $counter_font_size, 0, 0, $counter_font_size, $fc, $font, $count);

header("Content-type: image/gif");
imagegif($des);

function HEX2RGB($color){
$color = str_replace("#","",$color);
$color_array = array();
$hex_color = strtoupper($color);
for($i = 0; $i < 6; $i++){
$hex = substr($hex_color,$i,1);
switch($hex){
case "A": $num = 10; break;
case "B": $num = 11; break;
case "C": $num = 12; break;
case "D": $num = 13; break;
case "E": $num = 14; break;
case "F": $num = 15; break;
default: $num = $hex; break;
}
array_push($color_array,$num);
}
$R = (($color_array[0] * 16) + $color_array[1]);
$G = (($color_array[2] * 16) + $color_array[3]);
$B = (($color_array[4] * 16) + $color_array[5]);
return array($R,$G,$B);
unset($color_array,$hex,$R,$G,$B);
}
?>

i called like this to se if it works:

http://www.cet-utn.com.ar/imagenes/counter.php?count=123

and i get a:

Fatal error: Call to undefined function: imagettftext() in /home/cetutnx1/public_html/imagenes/counter.php on line 32
 
Last edited:

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Try again now..
Edit: Nope, hold on a min.
 
Last edited:

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
There ya go man. I see a few errors, so check your font's and all. The header() error should go away after the font "missing" error is fixed.
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Your welcome.

If you ever need any more PHP help, you know who to ask. ;-)
 
Status
Not open for further replies.
Top