mouser13 has asked for the wisdom of the Perl Monks concerning the following question:
client(cgi) sends the message to build the plot and print out the imageprint `/cwms/s0cwmsxx/v1.5.01/bin/dssVue $LINE.py /cwms/g7cwmspd/plot +Files/files/$num`; print "After command\n"; open(FH, "/cwms/g7cwmspd/plotFiles/files/$num.jpg"); binmode(FH); my $buf; while(<FH>) { read(FH,$buf,500); print $buf; print $client $buf; }
Any ideas why I'm not getting the first 200 or so bytes of header information? Ie.I ftp both files one created by the thrid party program and the one from my reading it. The one created by the thrid party program starts JFIF C and is 77,737. Looking closely it does have The below in it. So to me it looks like for somereason binmode perl is not read maybe the header information of the JPEG? My reading starts } !1AQa"q2#BR$3br and is 77,528 bytes and doesn't work correctly.print "Content-type: image/jpeg\n\n"; print $socket "$MESSAGE\n"; read($socket, $buffer,2097152); print "Content-type: image/jpeg\n\n"; print substr($buffer,1); open (OUTIMAGE,">/usr26/wcdb/log/plottest.jpg"); binmode(OUTIMAGE); print OUTIMAGE substr($buffer,1); close(OUTIMAGE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: JPEG cgi problem
by NetWallah (Canon) on Oct 28, 2012 at 15:14 UTC | |
|
Re: JPEG cgi problem
by aitap (Curate) on Oct 28, 2012 at 20:49 UTC |