<?php

require'config.php';

error_reporting(E_PARSE);
$nk=@$_SERVER['QUERY_STRING'];

$img = H.user_inf($nk,'photo');


$W = intval($_GET['W']);
$H = intval($_GET['H']);


$getim = getimagesize($img);
if ($getim[2] == 1 || $getim[2] == 2 || $getim[2] == 3) {

if ($getim[2] == 1)$old = imagecreatefromgif($img);
elseif ($getim[2] == 2) $old = imagecreatefromjpeg($img);
elseif ($getim[2] == 3)$old = imagecreatefrompng($img);
{
$wn = imageSX($old);
$hn = imageSY($old);

if(!$W and !$H)
{
$W = $set['w_photo']; // ширина картинки
$H = $set['h_photo']; // высота картинки
}

$new = imageCreateTrueColor($W, $H);
imagecopyResampled($new, $old, 0, 0, 0, 0, $W, $H, $wn, $hn);

// цвет
$color = imagecolorallocate($new, 255, 255, 255);

imagestring($new, 7, $W-(strlen(user_inf($nk,'vote_photo'))*15), 3, user_inf($nk,'vote_photo'), $color);


imageJpeg($new,null,100);
}
}



?>