$zoom_h = $max_thumb_h / $src_h;
$zoom_w = $max_thumb_w / $src_w;
$zoom = min($zoom_h, $zoom_w);
$dst_thumb_h = $zoom<1 ? round($src_h*$zoom) : $src_h;
$dst_thumb_w = $zoom<1 ? round($src_w*$zoom) : $src_w;
$dst_img = imagecreatetruecolor($dst_w,$dst_h);
$white = imagecolorallocate($dst_img,255,255,255);
$black = imagecolorallocate($dst_img,0,0,0);
$gray = imagecolorallocate($dst_img,127,127,127);
imagefill($dst_img,0,0,$white);
imagecopyresampled($dst_img,$src_img, 0,0,0,0, $dst_w,$dst_h,$src_w,$src_h);
if (imagecolorat($dst_img,5,5)>$gray) $tesxcolor=$black;
if (imagecolorat($dst_img,5,5)<$gray) $tesxcolor=$white;
//$textcolor = imagecolorallocate($dst_img, 255, 255, 255);
if (isset($tag)){
imagestring($dst_img, 5, 4, 4, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 6, 6, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 6, 4, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 4, 6, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 4, 5, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 6, 5, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 5, 4, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 5, 6, "$tag", $white-$textcolor);
imagestring($dst_img, 5, 5, 5, "$tag", $textcolor);
}
if($type == 'jpeg'){
$desc_img = $write($dst_img,"$path/$image_name", 75);
}else{
$desc_img = $write($dst_img,"$path/$image_name", 2);
}
$dst_t_img = imagecreatetruecolor($dst_thumb_w,$dst_thumb_h);
$white = imagecolorallocate($dst_img,255,255,255);
$black = imagecolorallocate($dst_img,0,0,0);
$gray = imagecolorallocate($dst_img,127,127,127);
imagefill($dst_t_img,0,0,$white);
imagecopyresampled($dst_t_img,$src_img, 0,0,0,0, $dst_thumb_w,$dst_thumb_h,$src_w,$src_h);
//$textcolor = imagecolorallocate($dst_t_img, 255, 255, 255);
if (imagecolorat($dst_t_img,2,2)>$gray) $tesxcolor=$black;
if (imagecolorat($dst_t_img,2,2)<$gray) $tesxcolor=$white;
if (isset($tag))
{
imagestring($dst_t_img, 2, 1, 1, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 3, 3, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 3, 1, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 1, 3, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 3, 2, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 3, 2, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 2, 1, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 2, 3, "$tag", $white-$textcolor);
imagestring($dst_t_img, 2, 2, 2, "$tag", $textcolor);
}
//imagestring($dst_t_img, 2, 2, 2, "$tag", $textcolor);
if($type == 'jpeg'){
$desc_img = $write($dst_t_img,"$path/$thumb_name", 75);
}else{
$desc_img = $write($dst_t_img,"$path/$thumb_name", 2);
}
вторая и третья цифры - координаты по х у соответственно, это вывод в левом верхнем углу. Если поковырять - можно настроить в любой позиции.
, подключить любой русский шрифт и писать по-русски.