char command[200];
sprintf(command,"comp_img > %s 2>&1",Stderr_file_name);
message("\nFixing to execute '%s' to compress an image\n",command);
system(command); // Call the compressor
// Now open the file again, for reading
if( (parm_fp = fopen(Parm_file_name,"r")) == 0 )
return CompReply(
error_msg("failed to open the parameter file for reading"),
0);
static char comp_image_result[100];
if( fgets(comp_image_result,sizeof(comp_image_result)-2,parm_fp) == 0 )
return CompReply( error_msg("failed to read the parameter file"), 0 );
fclose(parm_fp);
if( does_start_with(comp_image_result,"OK") )
{
sprintf(comp_image_result,"METX%s %s\n",request.SAT_cat_no,
request.compr_tag);
return CompReply(comp_image_result,Comp_image_file_name);
}
else
return CompReply(
error_msg("invalid status returned from the comp_img\n%s"
"\ntranscipt follows\n",comp_image_result),
Stderr_file_name);