in reply to Re: Email anti-harvester code
in thread Email anti-harvester code

Quick and dirty way to do the trick using GD:
#!/usr/bin/perl -w use GD; use GD::Text; my $gd_text = GD::Text->new() or die GD::Text::error(); $gd_text->set_font(gdSmallFont); $gd_text->set_text("nobody\@perlmonks.org"); my ($w, $h) = $gd_text->get('width', 'height'); my $gd = GD::Image->new($w,$h); $white = $gd->colorAllocate(255,255,255); $black = $gd->colorAllocate(0,0,0); $gd->transparent($white); $gd->string(gdSmallFont, 0, 0, "nobody\@perlmonks.org",$black); binmode STDOUT; print $gd->png;
perl -l -e "eval pack('h*','072796e647028222d2d202a0e49636f6c61637022292b3');"

Replies are listed 'Best First'.
Re: Re: Re: Email anti-harvester code
by chanio (Priest) on Oct 05, 2003 at 02:49 UTC
    You need to add two things to this graphic: at the html page...

    <img border="0" src="http://localhost/cgi-bin/grafem@il.cgi" alt="this + is my email" width="144" height="13">

    to call the script. And at the end of the script...

    print "Content-type:image/png\n\n"; print $gd->png;
    To fit an image into what was expected (see the content-type).