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

@$File = 'get/'.htmlspecialchars(trim($_GET['img']));
$x = intval($_GET['x']);
$y = intval($_GET['y']);

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

@$ImgCreate = imagecreatefrompng($File);
@$Weight = imageSX($ImgCreate);
@$Height = imageSY($ImgCreate);
@$NewImg = imagecreatetruecolor($x, $y);

$bry = intval($_GET['bry']);
$contr = intval($_GET['contr']);

if(@$_GET['blur']) {
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($ImgCreate, IMG_FILTER_GAUSSIAN_BLUR);
}
if(@$_GET['negative']) {
imagefilter($ImgCreate, IMG_FILTER_NEGATE);
}
if(@$_GET['briac']) {
imagefilter($ImgCreate, IMG_FILTER_BRIGHTNESS, $bry);
}
if(@$_GET['contrac']) {
imagefilter($ImgCreate, IMG_FILTER_CONTRAST, $contr);
}
if(@$_GET['smooth']) {
imagefilter($ImgCreate, IMG_FILTER_SMOOTH, 0);
}

@imageCopyResized($NewImg, $ImgCreate, 0, 0, 0, 0, $x, $y, $Weight, $Height);
imagePng($NewImg, 'get/'.md5($_GET['t']).'.png');
imagePng($NewImg);
?>