Oct 14, 2001, 11:38 AM
Post #2 of 3
You need to binmode standard output, too. I had the same problem just yesterday as an ftp download corrupted a bzipped archive. Fortunately I had Perl to s/\r\n/\n/g the file, and when I used exactly that on your corrupted gif, it looked pretty good.
For efficiency reasons, you might prefer the following script that reads/prints the whole file as one big block:
Hope this helps.
open GIF, 'images/nato.gif' or die "nato.gif: $!\n";
print "Content-type:image/gif\n\n", <GIF>;