note 21916 rejected from faq.using by jmcastagnetto
| From: | jmcastagnetto@php.net | Date: | Fri, 31 May 2002 05:29:26 +0000 |
| Subject: | note 21916 rejected from faq.using by jmcastagnetto | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-31257@lists.php.net to get a copy of this message | ||
I wish to do the following using php scripting techniques:
Accept text through a text box from a user, open an existing jpg file, place the user's text
upon it and save the composite as a different file. In order to do this I tried the following php
code.
-------------
<?php
$img_number = imagecreatefromjpeg ("blue-button.jpg");
$namee="web";
Imagettftext($img_number, 30,0,10,33,$black,"ARIAL.TTF",$namee);
$fp=fopen("button.jpg", "w+");
header("Content-type: image/jpeg");
imagejpeg($img_number,"button.jpg",100);
?>
---------------
I also put a jpg file called blue-button.jpg in the same folder where I put the php file. When I
try to run this php file on your servers I received the following error.
Error
=====
---------------
Warning: ImageTtfText: No TTF support in this PHP build in
/usr/www/users/copyline/test_myown/cpbon/test32.php on line 7
Warning: Cannot add header information - headers already sent by (output started at
/usr/www/users/copyline/test_myown/cpbon/test32.php:7) in
/usr/www/users/copyline/test_myown/cpbon/test32.php on line 11
-------------------
I would be grateful to you if you could tell me if this is the reason why the function is crashing
and how to rectify it, or, alternatively, let me know of a workaround that will solve the problem.