31 }
while (ch !=
'\n' && ch != EOF);
52 }
while (isspace(ch));
91 fprintf(stderr,
"Can't open table file %s\n",
filename);
98 fprintf(stderr,
"Too many tables in file %s\n",
filename);
102 table[0] = (
unsigned int)
val;
105 fprintf(stderr,
"Invalid table data in file %s\n",
filename);
115 if (termchar != EOF) {
116 fprintf(stderr,
"Non-numeric data in file %s\n",
filename);
126 #ifdef C_MULTISCAN_FILES_SUPPORTED
139 while (ch != EOF && isspace(ch))
142 if (ungetc(ch, file) == EOF)
149 if (ch != EOF && ch !=
';' && ch !=
':')
176 int scanno, ncomps, termchar;
179 #define MAX_SCANS 100
183 fprintf(stderr,
"Can't open scan definition file %s\n",
filename);
191 fprintf(stderr,
"Too many scans defined in file %s\n",
filename);
197 while (termchar ==
' ') {
199 fprintf(stderr,
"Too many components in one scan in file %s\n",
210 if (termchar ==
':') {
230 if (termchar !=
';' && termchar != EOF) {
232 fprintf(stderr,
"Invalid scan entry format in file %s\n",
filename);
239 if (termchar != EOF) {
240 fprintf(stderr,
"Non-numeric data in file %s\n",
filename);
254 cinfo->scan_info = scanptr;
255 cinfo->num_scans = scanno;
279 if (sscanf(
arg,
"%d%c", &
val, &ch) < 1)
284 fprintf(stderr,
"JPEG quantization tables are numbered 0..%d\n",
288 cinfo->comp_info[ci].quant_tbl_no =
val;
289 while (*
arg && *
arg++ !=
',')
293 cinfo->comp_info[ci].quant_tbl_no =
val;
313 if (sscanf(
arg,
"%d%c%d%c", &val1, &ch1, &val2, &ch2) < 3)
315 if ((ch1 !=
'x' && ch1 !=
'X') || ch2 !=
',')
317 if (val1 <= 0 || val1 > 4 || val2 <= 0 || val2 > 4) {
318 fprintf(stderr,
"JPEG sampling factors must be 1..4\n");
321 cinfo->comp_info[ci].h_samp_factor = val1;
322 cinfo->comp_info[ci].v_samp_factor = val2;
323 while (*
arg && *
arg++ !=
',')
327 cinfo->comp_info[ci].h_samp_factor = 1;
328 cinfo->comp_info[ci].v_samp_factor = 1;