in reply to Displaying Images

Also, I'd check your open like this:

open PNG, ">/kbase/anand/search/sw/cposupport/search/graph2.png" or die "Failed to open image file: $!\n";
Then for next steps:
  1. Find your web server's error log. Since that's where standard error will be going, look at the last entries to see if anything failed.
  2. If nothing failed, try just getting the created image using the URL you're putting in your image tag. It may be that this is not relative to your web server's document root.

Replies are listed 'Best First'.
Re: Re: Displaying Images
by mcc_anand (Initiate) on Feb 10, 2003 at 11:43 UTC
    I use apache 1.3.26 as the web server. After some debugging, i could get the image load onto my browser. But the apache error logs come out with binmode() on closed filehandle PNG at /kbase/anand/search/sw/cgi-bin/cposupport/ ccsearch/test.pl line 22. print() on closed filehandle PNG at /kbase/anand/search/sw/cgi-bin/cposupport/cc search/test.pl line 23. Is this just a warning that i can ignore? Please help i am new to Perl

      Did you add error checking to the open call? Sounds like that's failing if uses of PNG are generating errors afterwards. It may be permissions. Remember that your CGI runs as whatever user your Apache httpd.conf has the web server set to (default is nobody).

      But if there are errors like that I'm not seeing how you're getting the image to show unless you created it successfully outside of the web server environment (e.g., running your CGI manually) once along the way.