Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: GD malformed header error

by projekt21 (Friar)
on Apr 04, 2002 at 14:08 UTC ( #156660=note: print w/replies, xml ) Need Help??


in reply to GD malformed header error

When running a CGI you need to output (print) what the browser shall see. Normally this is HTML-Code, but plain text or images are fine, too.

First of all you need to print a header containing the content-type and two newlines:

print "Content-type: image/png\n\n"

... and remove that line saying: Context: ....

This should work for a trial.

I would further encourage you to use strict;, enable warnings (-w) AND use CGI;.

#!/usr/bin/perl -w use strict; use CGI; my $q = CGI->new; print $q->header("image/png"); ## later print $im->png;

I'm sure, GD is not to blame.

alex pleiner <alex@zeitform.de>
zeitform Internet Dienste

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://156660]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2021-04-15 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?