<?php
error_reporting(0);
header('Content-type: image/png');

@$File = 'get/'.htmlspecialchars(trim($_GET['img'])).'';
@$x = intval($_GET['x']);
@$y = intval($_GET['y']);
@$font = 'fonts/'.htmlspecialchars(trim($_GET['font']));
@$fsize = intval($_GET['fsize']);
@$rgbr = intval($_GET['rgbr']);
@$rgbg = intval($_GET['rgbg']);
@$rgbb = intval($_GET['rgbb']);
@$textx = intval($_GET['textx']);
@$texty = intval($_GET['texty']);
@$arrg = intval($_GET['arrg']);
@$text = htmlspecialchars(trim($_GET['text']));

if(@$x > 240) exit();
if(@$y > 320) exit();

@$ImgCreate = imagecreatefrompng($File);
@$Weight = imageSX($ImgCreate);
@$Height = imageSY($ImgCreate);
@$NewImg = imagecreatetruecolor($x, $y);
if(@$_GET['pp']) {
$col = imagecolorallocatealpha($ImgCreate, $rgbr, $rgbg, $rgbb, 50);
} elseif(@!$_GET['pp']) {
$col = imagecolorallocate($ImgCreate, $rgbr, $rgbg, $rgbb);
}
$shad = imagecolorallocatealpha($ImgCreate, 0, 0, 0, 50);

@imageCopyResized($NewImg, $ImgCreate, 0, 0, 0, 0, $x, $y, $Weight, $Height);
if(@$_GET['sh']) {
imagettftext($NewImg, $fsize, $arrg, ($textx+2), ($texty+2), $shad, $font, $text);
}
imagettftext($NewImg, $fsize, $arrg, $textx, $texty, $col, $font, $text);

imagePng($NewImg, 'get/'.md5($_GET['t']).'.png');
unlink($File);
ImagePng($NewImg);
?>