222{
223 int argn;
226 boolean simple_progressive;
227 char * qualityarg =
NULL;
228 char * qtablefile =
NULL;
229 char * qslotsarg =
NULL;
230 char * samplearg =
NULL;
231 char * scansarg =
NULL;
232
233
234
236 simple_progressive =
FALSE;
239 cinfo->err->trace_level = 0;
240
241
242
243 for (argn = 1; argn <
argc; argn++) {
246
247 if (argn <= last_file_arg_seen) {
249 continue;
250 }
251 break;
252 }
254
256
257#ifdef C_ARITH_CODING_SUPPORTED
259#else
260 fprintf(
stderr,
"%s: sorry, arithmetic coding not supported\n",
263#endif
264
266
268
270
271#if defined DCT_SCALING_SUPPORTED && JPEG_LIB_VERSION_MAJOR >= 8 && \
272 (JPEG_LIB_VERSION_MAJOR > 8 || JPEG_LIB_VERSION_MINOR >= 3)
274
279 if (val < 1 || val > 16)
282#else
283 fprintf(
stderr,
"%s: sorry, block size setting not supported\n",
286#endif
287
289
298 } else
300
302
303
304 static boolean printed_version =
FALSE;
305
306 if (! printed_version) {
307 fprintf(
stderr,
"Independent JPEG Group's CJPEG, version %s\n%s\n",
309 printed_version =
TRUE;
310 }
311 cinfo->err->trace_level++;
312
314
316
318
319#if JPEG_LIB_VERSION_MAJOR >= 9
320
321
322
324#endif
326
328
329#if JPEG_LIB_VERSION_MAJOR >= 9 && \
330 (JPEG_LIB_VERSION_MAJOR > 9 || JPEG_LIB_VERSION_MINOR >= 1)
332#else
333 fprintf(
stderr,
"%s: sorry, BG_YCC colorspace not supported\n",
336#endif
337
339
340 long lval;
341 char ch = 'x';
342
345 if (
sscanf(
argv[argn],
"%ld%c", &lval, &ch) < 1)
347 if (ch == 'm' || ch == 'M')
348 lval *= 1000L;
349 cinfo->mem->max_memory_to_use = lval * 1000L;
350
352
354
356
357#ifdef ENTROPY_OPT_SUPPORTED
359#else
360 fprintf(
stderr,
"%s: sorry, entropy optimization was not compiled\n",
363#endif
364
366
370
372
373#ifdef C_PROGRESSIVE_SUPPORTED
374 simple_progressive =
TRUE;
375
376#else
377 fprintf(
stderr,
"%s: sorry, progressive output was not compiled\n",
380#endif
381
383
386 qualityarg =
argv[argn];
387
389
392 qslotsarg =
argv[argn];
393
394
395
396
397
399
402 qtablefile =
argv[argn];
403
404
406
407 long lval;
408 char ch = 'x';
409
412 if (
sscanf(
argv[argn],
"%ld%c", &lval, &ch) < 1)
414 if (lval < 0 || lval > 65535L)
416 if (ch == 'b' || ch == 'B') {
419 } else {
421
422 }
423
425
428 samplearg =
argv[argn];
429
430
431
432
433
435
441
443
444#ifdef C_MULTISCAN_FILES_SUPPORTED
447 scansarg =
argv[argn];
448
449#else
450 fprintf(
stderr,
"%s: sorry, multi-scan output was not compiled\n",
453#endif
454
456
458
463 if (val < 0 || val > 100)
466
468
470
471 } else {
473 }
474 }
475
476
477
478 if (for_real) {
479
480
481
482 if (qualityarg !=
NULL)
485
486 if (qtablefile !=
NULL)
489
490 if (qslotsarg !=
NULL)
493
494 if (samplearg !=
NULL)
497
498#ifdef C_PROGRESSIVE_SUPPORTED
499 if (simple_progressive)
500 jpeg_simple_progression(cinfo);
501#endif
502
503#ifdef C_MULTISCAN_FILES_SUPPORTED
504 if (scansarg !=
NULL)
505 if (! read_scan_script(cinfo, scansarg))
507#endif
508 }
509
510 return argn;
511}
keymatch(char *arg, const char *keyword, int minchars)
char boolean force_baseline
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
jpeg_set_colorspace(j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
set_quality_ratings(j_compress_ptr cinfo, char *arg, boolean force_baseline)
read_quant_tables(j_compress_ptr cinfo, char *filename, boolean force_baseline)
set_sample_factors(j_compress_ptr cinfo, char *arg)
set_quant_slots(j_compress_ptr cinfo, char *arg)
J_COLOR_TRANSFORM color_transform
unsigned int restart_interval
boolean do_fancy_downsampling