Hello I'm having a bit of issue I have thrid party program that builds a JPEG(JFIF really). For some reason when I try to read it in perl binmode it removes the header information.
Server code recieves plot to build and passes back the image data
print `/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;
}
client(cgi) sends the message to build the plot and print out the image
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);
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.