Я наложил текст на изображение (которое уже есть на моем сервере), используя GD. Я пытаюсь сохранить новое изображение на сервере.
Ниже приведен мой код, но все, что он делает - показывает новое изображение в браузере, которое не сохраняет его на сервере.
<?
//PHP's GD class functions can create a variety of output image
//types, this example creates a jpeg
header("Content-Type: image/jpeg");
$im = imagecreatefromjpeg($image_full);
$black = ImageColorAllocate($im, 255, 255, 255);
$copy_1_x = 10;
$copy_1_y = 20;
$copy_2_x = 10;
$copy_2_y = 20;
$copy_3_x = 10;
$copy_3_y = 20;
//writes text to image
Imagettftext($im, 12, 0, $copy_1_x, $copy_1_y, $black, 'verdana.ttf', $main_number);
Imagettftext($im, 12, 0, $copy_2_x, $copy_2_y, $black, 'verdana.ttf', $prime_number);
Imagettftext($im, 12, 0, $copy_3_x, $copy_3_y, $black, 'verdana.ttf', $legal);
//Creates the jpeg image and sends it to the browser
//100 is the jpeg quality percentage
Imagejpeg($im, '', 100);
ImageDestroy($im);
?>