SYP}{ER
11-11-2002, 09:40 PM
<?
header("content-type: image/jpeg");
if(isset($string)) {
$text_height = 18;
$image_height = 26;
$tfont = "deftone.ttf";
$string = stripslashes($string);
$tst = ImageTTFBBox($text_height,0,$tfont,$string);
$widtxt = ($tst[2]-$tst[0]);
$heitxt = ($tst[5]-$tst[3]);
$btnwid = $widtxt+12;
$thebtn = ImageCreate($btnwid,$image_height);
$blk = ImageColorAllocate($thebtn,0,0,0);
ImageFill($thebtn,0,0,$blk);
$colour = ImageColorAllocate($thebtn,255,204,0);
$txtx = 6;
$txty = $text_height;
ImageTTFText ($thebtn,$text_height,0,$txtx,$txty,$colour,$tfont,$string);
ImagePNG($thebtn);
ImageDestroy($thebtn);
}
else {}
?>
See it live: http://sean.aaron-wright.com/images/titlemaker.php?string=Home
The error:
Could not find/open font in /home/virtual/site24/fst/var/www/html/images/titlemaker.php on line 8 and 18
Now the font is in the same folder as the script (images/) and is CHMODed to 777 (full permissions). What's goin' on?
Thanks :)
header("content-type: image/jpeg");
if(isset($string)) {
$text_height = 18;
$image_height = 26;
$tfont = "deftone.ttf";
$string = stripslashes($string);
$tst = ImageTTFBBox($text_height,0,$tfont,$string);
$widtxt = ($tst[2]-$tst[0]);
$heitxt = ($tst[5]-$tst[3]);
$btnwid = $widtxt+12;
$thebtn = ImageCreate($btnwid,$image_height);
$blk = ImageColorAllocate($thebtn,0,0,0);
ImageFill($thebtn,0,0,$blk);
$colour = ImageColorAllocate($thebtn,255,204,0);
$txtx = 6;
$txty = $text_height;
ImageTTFText ($thebtn,$text_height,0,$txtx,$txty,$colour,$tfont,$string);
ImagePNG($thebtn);
ImageDestroy($thebtn);
}
else {}
?>
See it live: http://sean.aaron-wright.com/images/titlemaker.php?string=Home
The error:
Could not find/open font in /home/virtual/site24/fst/var/www/html/images/titlemaker.php on line 8 and 18
Now the font is in the same folder as the script (images/) and is CHMODed to 777 (full permissions). What's goin' on?
Thanks :)