Доброго времени суток!
Собственно, код:
<?php
header('Content-type: image/jpeg');
$jpg_image = imagecreatefromjpeg('r4.jpg');
$white = imagecolorallocate($jpg_image, 255, 255, 255);
$grey = imagecolorallocate($jpg_image, 0, 0, 0);
$font_path = 'arial.TTF';
$string = 'one';
$box = imagettfbbox(100, 0, $font_path, $string);
$CENTER = 350;
$left = $CENTER-round(($box[2]-$box[0])/2)-52;
$text = $string{0};
imagettftext($jpg_image, 100, 0, $left, 668, $grey, $font_path, $string);
imagettftext($jpg_image, 100, 0, $left, 665, $white, $font_path, $string);
imagettftext($jpg_image, 100, 0, 52, 668, $grey,$font_path, $text);
imagettftext($jpg_image, 100, 0, 52, 665, $white, $font_path, $text);
imagejpeg($jpg_image);
imagedestroy($jpg_image);
?>
Выводит "испорченное" изображение. .ttf и .jpg в папке со скриптом есть.
Картинка 700x700.
-
Вопрос задан
-
2503 просмотра