<?php
header("Content-type: image/png");
// First of all, check if there is a cached image of this route in the cache/ folder
//
$cache_file = '../cache/bgtxt_'.urlencode($_GET['t']).'.png';
if(file_exists($cache_file)) {
die(file_get_contents($cache_file));
}
$im = imagecreatetruecolor(300, 100);
$background = imagecolorallocate($im, 237, 246, 249);
$color = imagecolorallocate($im, 206, 234, 239);
imagefilledrectangle($im, 0, 0, 300, 100, $background);
imagettftext($im, 45, -8, 18+round(rand(0,100)), 20, $color, 'OLDFAX.TTF', $_GET['t']);
// Save a cached image in the cache folder
if(GEO_DECORATION_CACHE) { //be careful! anione can generate this files!!! oops
imagepng($im,$cache_file,6); //compression can be set from 0 (no compression) to 9
}
imagepng($im);
imagedestroy($im);
?>