Can anybody tell me why my Dynamic Image takes AGES to load?
This is my script:
[code=php]<?php
require_once(‘stats.class.php’);
$gamertag = $_GET[‘gt’];
$gtfix = str_replace(‘-‘, ‘ ‘, $gamertag);
$gamertag = $_GET[‘gt’];
$gtfix = str_replace(‘-‘, ‘ ‘, $gamertag);
header(‘Content-type: image/png’);
$im = imagecreatefrompng(“stats.png”);
if(!$im) { die; }
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);
$width = imagesx($im);
$height = imagesy($im);
$font = ‘segoesc.ttf’;
$verdana = ‘verdana.ttf’;
$highlevel = “Highest Level: “.halo3stats($gtfix, “highestlevel”);
$totalgames = “Total Games: “.halo3stats($gtfix, “totalgames”);
$rank = halo3stats($gtfix, “rank”);
$totalexp = “EXP: “.halo3stats($gtfix, “totalexp”);
$kills = “Kills: “.halo3stats($gtfix, “kills”);
$lastplayed = “Last Played: “.halo3stats($gtfix, “lastplayed”);
$playersince = “Player Since: “.halo3stats($gtfix, “playersince”);
$rankimg = halo3stats($gtfix, “rankimg”);
$rankimg = imagecreatefromgif($rankimg);
$rankimg_x = imagesx($rankimg);
$rankimg_y = imagesy($rankimg);
imagettftext($im, 12, 0, 94, 51, $white, $font, $gtfix);
//imagettftext($im, 12, 0, 92, 49, $red, $font, $gtfix);
imagettftext($im, 12, 0, 93, 50, $black, $font, $gtfix);
imagettftext($im, 8, 0, 94, 65, $black, $verdana, $rank);
imagettftext($im, 8, 0, 93, 64, $red, $verdana, $rank);
imagettftext($im, 8, 0, 94, 76, $white, $verdana, $highlevel);
imagettftext($im, 8, 0, 93, 75, $black, $verdana, $highlevel);
imagettftext($im, 8, 0, 94, 87, $white, $verdana, $totalexp);
imagettftext($im, 8, 0, 93, 86, $black, $verdana, $totalexp);
imagettftext($im, 8, 0, 94, 98, $white, $verdana, $totalgames);
imagettftext($im, 8, 0, 93, 97, $black, $verdana, $totalgames);
imagettftext($im, 8, 0, 94, 109, $white, $verdana, $kills);
imagettftext($im, 8, 0, 93, 108, $black, $verdana, $kills);
imagettftext($im, 8, 0, 5, 15, $black, $verdana, $lastplayed);
imagettftext($im, 8, 0, 5, 26, $black, $verdana, $playersince);
imagecopymerge($im, $rankimg, 23, 33, 0, 0, $rankimg_x, $rankimg_y, 100);
imagepng($im);
imagedestroy($im);
?>
Is it because my font file is very large?