#20129 [Com]: ImageTTFText & implode(" ", "$argv")
| From: | jbw at justinw dot net | Date: | Mon, 28 Oct 2002 23:21:29 +0000 |
| Subject: | #20129 [Com]: ImageTTFText & implode(" ", "$argv") | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-23605@lists.php.net to get a copy of this message | ||
ID: 20129
Comment by: jbw@justinw.net
Reported By: jbw@justinw.net
Status: Bogus
Bug Type: GD related
Operating System: Linux 2.x
PHP Version: 4.2.3
New Comment:
Oh, I don't know why I did that.... I took the "" off and it is still
not working... errrr... Any ideas? Sorry to take up your guys time on
this...
- Justin
Previous Comments:
------------------------------------------------------------------------
[2002-10-28 16:46:26] rasmus@php.net
$argv is an array, and implode() takes an array. Sterling is wondering
to the powers that be why in God's name you passed $argv in quotes
(thereby making it a string) to the implode function.
------------------------------------------------------------------------
[2002-10-28 16:35:07] jbw@justinw.net
Ok, the status is changed to Bogus. Is this working as designed and not
a problem/bug? Thanks,
- Justin
------------------------------------------------------------------------
[2002-10-27 22:07:41] sterling@php.net
ohhh, god...
------------------------------------------------------------------------
[2002-10-27 20:48:08] jbw@justinw.net
I cannot use implode with the ImageTTFText function.
The following code does not work, it returns a broken image:
<?php
Header("Content-type: image/png");
//$string = "Test";
$string = implode(" ", "$argv");
$string = urldecode($string);
$im = imageCreateFromPng("header_img2.png");
$white = ImageColorAllocate($im, 167, 194, 206);
$px = (imagesx($im)-7.5*strlen($string))/2;
ImageTTFText($im, 30, 0, $px, 42, $white,
"/usr/local/apache/htdocs/ttf/ARTBRUSH.TTF", "$string");
ImagePng($im);
ImageDestroy($im);
?>
If I comment out the implode line and set $string then it works great.
I use implode with other code for creating other images but not with
ImageTTFText.
Thanks!
- Justin
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=20129&edit=1