Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

there is a logging script that log statistic, script called when the page is loaded via image tags.
<img src="http://www.yoursite.com/cgi-bin/logs.pl" height="1" width="1">
Here is end part of code:
print "Content-type: image/x-xbitmap\n\n"; print "#define name_width 1"; print "\n"; print "#define name_height 1"; print "\n"; print "static char name_bits[] = { 0x04 };"; print "\n";
Should be there an small image to be placed in cgi-bin folder, to make script work correctly, return a small gif, or no image required?(I have no script's original package) If so, what image?

Retitled by Steve_p from 'question about image'.

Replies are listed 'Best First'.
Re: Returning image data from cgi script
by ikegami (Patriarch) on May 04, 2005 at 16:59 UTC

    No external image file is required.

    #define name_width 1 #define name_height 1 static char name_bits[] = { 0x04 };

    is an image.

      THANK YOU.
Re: Returning image data from cgi script
by Joost (Canon) on May 04, 2005 at 16:57 UTC
Re: Returning image data from cgi script
by cees (Curate) on May 04, 2005 at 18:27 UTC

    If you want to return a 1x1 blank GIF image instead of a bitmap, you can try the following:

    use MIME::Base64 qw(decode_base64); print "Content-type: image/gif\n\n"; print decode_base64 'R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAQAICRAEAOwA7';

    I'll admit it is not quite as pretty as the bitmap version though!

    - Cees