0) { $imageNumber = time() % count($fileList); $img = $folder.$fileList[$imageNumber]; } } if ($img!=null) { $imageInfo = pathinfo($img); $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ]; header ($contentType); $image = imagecreatefromjpeg($img); $breedte = imagesx($image); $hoogte = imagesy($image); $text = ''; if(isset($_GET['nick'])) $text = $_GET['nick']; $font_size = 2; $tekstkleur = imagecolorallocate($image, 0, 0, 0); if(isset($_GET['fontcolor']) and strlen($_GET['fontcolor']) == 6) { $tekstkleur = imagecolorallocate($image, hexdec(substr($_GET['fontcolor'],0,2)), hexdec(substr($_GET['fontcolor'],2,2)), hexdec(substr($_GET['fontcolor'],4,2))); } $align = 'center'; if(isset($_GET['align']) and ($_GET['align'] == 'left' or $_GET['align'] == 'right')) $align = $_GET['align']; if($align == 'left') imagestring($image, $font_size, 2, $hoogte - imagefontheight($font_size) - 2, $text, $tekstkleur); if($align == 'center') imagestring($image, $font_size, $breedte/2 - strlen($text) * 0.5 * imagefontwidth($font_size), $hoogte - imagefontheight($font_size) - 2, $text, $tekstkleur); if($align == 'right') imagestring($image, $font_size, $breedte - strlen($text) * imagefontwidth($font_size) - 2, $hoogte - imagefontheight($font_size) - 2, $text, $tekstkleur); imagejpeg($image); imagedestroy($image); } else { if ( function_exists('imagecreate') ) { header ("Content-type: image/png"); $im = @imagecreate (60, 60) or die ("Cannot initialize new GD image stream"); $background_color = imagecolorallocate ($im, 0, 0, 0); $text_color = imagecolorallocate ($im, 0,0,0); imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color); imagepng ($im); imagedestroy($im); } } ?>