0
if ($typeok)
{
list($w, $h) = getimagesize($saveto);
$tw = $w;
$th = $h;
$max = 100;
if($w > $h && $max < $w)
{
$th = $max/$w * $h;
$tw = $max;
}
elseif ($h > $w && $max < $h)
{
$tw = $max/$h * $w;
$th = $max;
}
elseif ($max < $w)
{
$tw = $th = $max;
}
$tmp = imagecreatetruecolor($tw, $th);
imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tw, $th, $w, $h);
imageconvolution($tmp, array(array(-1, -1, -1), array(-1, 16, -1), array(-1, -1, -1)), 8, 0);
imagejpeg($tmp, $saveto);
imagedestroy($tmp);
imagedestroy($src);
}