470,604 Members | 2,293 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,604 developers. It's quick & easy.

GD text in existing image

I'm trying to put text in an existing image. I got this working with the
following code.
I need this because I am making a FAQ and want certain screenshots with auto
filled in names
I tried putting this lines in a working script though I get carbage on my
screen now.. I think this is a result of a conflict between content-type:
HTML/Text\n\n en binmode ?!?

How can I overcome this ?!?
#!/usr/bin/perl -w

use GD;

$im = newFromPng GD::Image("../../images/frontpage/circle.png");
$black = $im->colorAllocate(0,0,0);
$im->string(gdSmallFont,2,10,"Testing",$black);
binmode STDOUT;
print $im->png;
Jul 19 '05 #1
1 4046
Daniel van den Oord wrote:
carbage... I think this is a result of a conflict between content-type:
HTML/Text\n\n en binmode ?!?


You're supposed to output "Content-type: image/png\n\n"
before setting STDOUT to binmode.
-Joe
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Rare Book School | last post: by
1 post views Thread by Andrew Poulos | last post: by
6 posts views Thread by David Stone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.