ReactOS  0.4.13-dev-982-g9853eab
jpegtran.c File Reference
#include "cdjpeg.h"
#include "transupp.h"
#include "jversion.h"
Include dependency graph for jpegtran.c:

Go to the source code of this file.

Functions

 usage (void)
 
 select_transform (JXFORM_CODE transform)
 
 parse_switches (j_compress_ptr cinfo, int argc, char **argv, int last_file_arg_seen, boolean for_real)
 
int main (int argc, char **argv)
 

Variables

static const charprogname
 
static charoutfilename
 
static charscaleoption
 
static JCOPY_OPTION copyoption
 
static jpeg_transform_info transformoption
 

Function Documentation

◆ main()

int main ( int argc  ,
char **  argv 
)

Definition at line 386 of file jpegtran.c.

387 {
388  struct jpeg_decompress_struct srcinfo;
390  struct jpeg_error_mgr jsrcerr, jdsterr;
391 #ifdef PROGRESS_REPORT
393 #endif
394  jvirt_barray_ptr * src_coef_arrays;
395  jvirt_barray_ptr * dst_coef_arrays;
396  int file_index;
397  /* We assume all-in-memory processing and can therefore use only a
398  * single file pointer for sequential input and output operation.
399  */
400  FILE * fp;
401 
402  /* On Mac, fetch a command line. */
403 #ifdef USE_CCOMMAND
404  argc = ccommand(&argv);
405 #endif
406 
407  progname = argv[0];
408  if (progname == NULL || progname[0] == 0)
409  progname = "jpegtran"; /* in case C library doesn't provide it */
410 
411  /* Initialize the JPEG decompression object with default error handling. */
412  srcinfo.err = jpeg_std_error(&jsrcerr);
413  jpeg_create_decompress(&srcinfo);
414  /* Initialize the JPEG compression object with default error handling. */
415  dstinfo.err = jpeg_std_error(&jdsterr);
417 
418  /* Now safe to enable signal catcher.
419  * Note: we assume only the decompression object will have virtual arrays.
420  */
421 #ifdef NEED_SIGNAL_CATCHER
422  enable_signal_catcher((j_common_ptr) &srcinfo);
423 #endif
424 
425  /* Scan command line to find file names.
426  * It is convenient to use just one switch-parsing routine, but the switch
427  * values read here are mostly ignored; we will rescan the switches after
428  * opening the input file. Also note that most of the switches affect the
429  * destination JPEG object, so we parse into that and then copy over what
430  * needs to affects the source too.
431  */
432 
433  file_index = parse_switches(&dstinfo, argc, argv, 0, FALSE);
434  jsrcerr.trace_level = jdsterr.trace_level;
435  srcinfo.mem->max_memory_to_use = dstinfo.mem->max_memory_to_use;
436 
437 #ifdef TWO_FILE_COMMANDLINE
438  /* Must have either -outfile switch or explicit output file name */
439  if (outfilename == NULL) {
440  if (file_index != argc-2) {
441  fprintf(stderr, "%s: must name one input and one output file\n",
442  progname);
443  usage();
444  }
445  outfilename = argv[file_index+1];
446  } else {
447  if (file_index != argc-1) {
448  fprintf(stderr, "%s: must name one input and one output file\n",
449  progname);
450  usage();
451  }
452  }
453 #else
454  /* Unix style: expect zero or one file name */
455  if (file_index < argc-1) {
456  fprintf(stderr, "%s: only one input file\n", progname);
457  usage();
458  }
459 #endif /* TWO_FILE_COMMANDLINE */
460 
461  /* Open the input file. */
462  if (file_index < argc) {
463  if ((fp = fopen(argv[file_index], READ_BINARY)) == NULL) {
464  fprintf(stderr, "%s: can't open %s for reading\n", progname, argv[file_index]);
466  }
467  } else {
468  /* default input file is stdin */
469  fp = read_stdin();
470  }
471 
472 #ifdef PROGRESS_REPORT
473  start_progress_monitor((j_common_ptr) &dstinfo, &progress);
474 #endif
475 
476  /* Specify data source for decompression */
477  jpeg_stdio_src(&srcinfo, fp);
478 
479  /* Enable saving of extra markers that we want to copy */
480  jcopy_markers_setup(&srcinfo, copyoption);
481 
482  /* Read file header */
483  (void) jpeg_read_header(&srcinfo, TRUE);
484 
485  /* Adjust default decompression parameters */
486  if (scaleoption != NULL)
487  if (sscanf(scaleoption, "%u/%u",
488  &srcinfo.scale_num, &srcinfo.scale_denom) < 1)
489  usage();
490 
491  /* Any space needed by a transform option must be requested before
492  * jpeg_read_coefficients so that memory allocation will be done right.
493  */
494 #if TRANSFORMS_SUPPORTED
495  /* Fail right away if -perfect is given and transformation is not perfect.
496  */
497  if (!jtransform_request_workspace(&srcinfo, &transformoption)) {
498  fprintf(stderr, "%s: transformation is not perfect\n", progname);
500  }
501 #endif
502 
503  /* Read source file as DCT coefficients */
504  src_coef_arrays = jpeg_read_coefficients(&srcinfo);
505 
506  /* Initialize destination compression parameters from source values */
508 
509  /* Adjust destination parameters if required by transform options;
510  * also find out which set of coefficient arrays will hold the output.
511  */
512 #if TRANSFORMS_SUPPORTED
513  dst_coef_arrays = jtransform_adjust_parameters(&srcinfo, &dstinfo,
514  src_coef_arrays,
515  &transformoption);
516 #else
517  dst_coef_arrays = src_coef_arrays;
518 #endif
519 
520  /* Close input file, if we opened it.
521  * Note: we assume that jpeg_read_coefficients consumed all input
522  * until JPEG_REACHED_EOI, and that jpeg_finish_decompress will
523  * only consume more while (! cinfo->inputctl->eoi_reached).
524  * We cannot call jpeg_finish_decompress here since we still need the
525  * virtual arrays allocated from the source object for processing.
526  */
527  if (fp != stdin)
528  fclose(fp);
529 
530  /* Open the output file. */
531  if (outfilename != NULL) {
532  if ((fp = fopen(outfilename, WRITE_BINARY)) == NULL) {
533  fprintf(stderr, "%s: can't open %s for writing\n", progname, outfilename);
535  }
536  } else {
537  /* default output file is stdout */
538  fp = write_stdout();
539  }
540 
541  /* Adjust default compression parameters by re-parsing the options */
542  file_index = parse_switches(&dstinfo, argc, argv, 0, TRUE);
543 
544  /* Specify data destination for compression */
545  jpeg_stdio_dest(&dstinfo, fp);
546 
547  /* Start compressor (note no image data is actually written here) */
548  jpeg_write_coefficients(&dstinfo, dst_coef_arrays);
549 
550  /* Copy to the output file any extra markers that we want to preserve */
552 
553  /* Execute image transformation, if any */
554 #if TRANSFORMS_SUPPORTED
555  jtransform_execute_transformation(&srcinfo, &dstinfo,
556  src_coef_arrays,
557  &transformoption);
558 #endif
559 
560  /* Finish compression and release memory */
563  (void) jpeg_finish_decompress(&srcinfo);
564  jpeg_destroy_decompress(&srcinfo);
565 
566  /* Close output file, if we opened it */
567  if (fp != stdout)
568  fclose(fp);
569 
570 #ifdef PROGRESS_REPORT
571  end_progress_monitor((j_common_ptr) &dstinfo);
572 #endif
573 
574  /* All done. */
575  exit(jsrcerr.num_warnings + jdsterr.num_warnings ?EXIT_WARNING:EXIT_SUCCESS);
576  return 0; /* suppress no-return-value warnings */
577 }
#define READ_BINARY
Definition: jmemdos.c:77
static int argc
Definition: ServiceArgs.c:12
jpeg_read_header(j_decompress_ptr cinfo, boolean require_image)
Definition: jdapimin.c:245
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
jpeg_finish_compress(j_compress_ptr cinfo)
Definition: jcapimin.c:155
static const char * progname
Definition: jpegtran.c:38
jpeg_destroy_compress(j_compress_ptr cinfo)
Definition: jcapimin.c:96
FILE * stdin
#define argv
Definition: mplay32.c:18
jpeg_stdio_dest(j_compress_ptr cinfo, FILE *outfile)
Definition: jdatadst.c:196
parse_switches(j_compress_ptr cinfo, int argc, char **argv, int last_file_arg_seen, boolean for_real)
Definition: jpegtran.c:121
FILE * stdout
read_stdin(void)
Definition: cdjpeg.c:149
#define EXIT_SUCCESS
Definition: rdjpgcom.c:55
#define jpeg_create_decompress(cinfo)
Definition: jpeglib.h:961
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
jpeg_copy_critical_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo)
Definition: jctrans.c:64
jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo, JCOPY_OPTION option)
Definition: transupp.c:1776
#define EXIT_WARNING
Definition: cdjpeg.h:185
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
static char * scaleoption
Definition: jpegtran.c:40
jpeg_stdio_src(j_decompress_ptr cinfo, FILE *infile)
Definition: jdatasrc.c:210
#define EXIT_FAILURE
Definition: jerror.c:33
usage(void)
Definition: jpegtran.c:46
static char * outfilename
Definition: jpegtran.c:39
jpeg_finish_decompress(j_decompress_ptr cinfo)
Definition: jdapimin.c:373
j_compress_ptr dstinfo
Definition: jpeglib.h:1097
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
jpeg_destroy_decompress(j_decompress_ptr cinfo)
Definition: jdapimin.c:92
#define WRITE_BINARY
Definition: wrjpgcom.c:47
jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
Definition: transupp.c:1751
static jpeg_transform_info transformoption
Definition: jpegtran.c:42
#define jpeg_create_compress(cinfo)
Definition: jpeglib.h:958
cd_progress_ptr progress
Definition: cdjpeg.h:150
write_stdout(void)
Definition: cdjpeg.c:167
jpeg_std_error(struct jpeg_error_mgr *err)
Definition: jerror.c:232
FILE * stderr
void exit(int exitcode)
Definition: _exit.c:33
static JCOPY_OPTION copyoption
Definition: jpegtran.c:41

◆ parse_switches()

parse_switches ( j_compress_ptr  cinfo,
int  argc,
char **  argv,
int  last_file_arg_seen,
boolean  for_real 
)

Definition at line 121 of file jpegtran.c.

131 {
132  int argn;
133  char * arg;
134  boolean simple_progressive;
135  char * scansarg = NULL; /* saves -scans parm if any */
136 
137  /* Set up default JPEG parameters. */
138  simple_progressive = FALSE;
139  outfilename = NULL;
140  scaleoption = NULL;
147  cinfo->err->trace_level = 0;
148 
149  /* Scan command line options, adjust parameters */
150 
151  for (argn = 1; argn < argc; argn++) {
152  arg = argv[argn];
153  if (*arg != '-') {
154  /* Not a switch, must be a file name argument */
155  if (argn <= last_file_arg_seen) {
156  outfilename = NULL; /* -outfile applies to just one input file */
157  continue; /* ignore this name if previously processed */
158  }
159  break; /* else done parsing switches */
160  }
161  arg++; /* advance past switch marker character */
162 
163  if (keymatch(arg, "arithmetic", 1)) {
164  /* Use arithmetic coding. */
165 #ifdef C_ARITH_CODING_SUPPORTED
166  cinfo->arith_code = TRUE;
167 #else
168  fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
169  progname);
171 #endif
172 
173  } else if (keymatch(arg, "copy", 2)) {
174  /* Select which extra markers to copy. */
175  if (++argn >= argc) /* advance to next argument */
176  usage();
177  if (keymatch(argv[argn], "none", 1)) {
179  } else if (keymatch(argv[argn], "comments", 1)) {
181  } else if (keymatch(argv[argn], "all", 1)) {
183  } else
184  usage();
185 
186  } else if (keymatch(arg, "crop", 2)) {
187  /* Perform lossless cropping. */
188 #if TRANSFORMS_SUPPORTED
189  if (++argn >= argc) /* advance to next argument */
190  usage();
191  if (transformoption.crop /* reject multiple crop/wipe requests */ ||
192  ! jtransform_parse_crop_spec(&transformoption, argv[argn])) {
193  fprintf(stderr, "%s: bogus -crop argument '%s'\n",
194  progname, argv[argn]);
196  }
197 #else
198  select_transform(JXFORM_NONE); /* force an error */
199 #endif
200 
201  } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
202  /* Enable debug printouts. */
203  /* On first -d, print version identification */
204  static boolean printed_version = FALSE;
205 
206  if (! printed_version) {
207  fprintf(stderr, "Independent JPEG Group's JPEGTRAN, version %s\n%s\n",
209  printed_version = TRUE;
210  }
211  cinfo->err->trace_level++;
212 
213  } else if (keymatch(arg, "flip", 1)) {
214  /* Mirror left-right or top-bottom. */
215  if (++argn >= argc) /* advance to next argument */
216  usage();
217  if (keymatch(argv[argn], "horizontal", 1))
219  else if (keymatch(argv[argn], "vertical", 1))
221  else
222  usage();
223 
224  } else if (keymatch(arg, "grayscale", 1) || keymatch(arg, "greyscale",1)) {
225  /* Force to grayscale. */
226 #if TRANSFORMS_SUPPORTED
228 #else
229  select_transform(JXFORM_NONE); /* force an error */
230 #endif
231 
232  } else if (keymatch(arg, "maxmemory", 3)) {
233  /* Maximum memory in Kb (or Mb with 'm'). */
234  long lval;
235  char ch = 'x';
236 
237  if (++argn >= argc) /* advance to next argument */
238  usage();
239  if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
240  usage();
241  if (ch == 'm' || ch == 'M')
242  lval *= 1000L;
243  cinfo->mem->max_memory_to_use = lval * 1000L;
244 
245  } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
246  /* Enable entropy parm optimization. */
247 #ifdef ENTROPY_OPT_SUPPORTED
248  cinfo->optimize_coding = TRUE;
249 #else
250  fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n",
251  progname);
253 #endif
254 
255  } else if (keymatch(arg, "outfile", 4)) {
256  /* Set output file name. */
257  if (++argn >= argc) /* advance to next argument */
258  usage();
259  outfilename = argv[argn]; /* save it away for later use */
260 
261  } else if (keymatch(arg, "perfect", 2)) {
262  /* Fail if there is any partial edge MCUs that the transform can't
263  * handle. */
265 
266  } else if (keymatch(arg, "progressive", 2)) {
267  /* Select simple progressive mode. */
268 #ifdef C_PROGRESSIVE_SUPPORTED
269  simple_progressive = TRUE;
270  /* We must postpone execution until num_components is known. */
271 #else
272  fprintf(stderr, "%s: sorry, progressive output was not compiled\n",
273  progname);
275 #endif
276 
277  } else if (keymatch(arg, "restart", 1)) {
278  /* Restart interval in MCU rows (or in MCUs with 'b'). */
279  long lval;
280  char ch = 'x';
281 
282  if (++argn >= argc) /* advance to next argument */
283  usage();
284  if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
285  usage();
286  if (lval < 0 || lval > 65535L)
287  usage();
288  if (ch == 'b' || ch == 'B') {
289  cinfo->restart_interval = (unsigned int) lval;
290  cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
291  } else {
292  cinfo->restart_in_rows = (int) lval;
293  /* restart_interval will be computed during startup */
294  }
295 
296  } else if (keymatch(arg, "rotate", 2)) {
297  /* Rotate 90, 180, or 270 degrees (measured clockwise). */
298  if (++argn >= argc) /* advance to next argument */
299  usage();
300  if (keymatch(argv[argn], "90", 2))
302  else if (keymatch(argv[argn], "180", 3))
304  else if (keymatch(argv[argn], "270", 3))
306  else
307  usage();
308 
309  } else if (keymatch(arg, "scale", 4)) {
310  /* Scale the output image by a fraction M/N. */
311  if (++argn >= argc) /* advance to next argument */
312  usage();
313  scaleoption = argv[argn];
314  /* We must postpone processing until decompression startup. */
315 
316  } else if (keymatch(arg, "scans", 1)) {
317  /* Set scan script. */
318 #ifdef C_MULTISCAN_FILES_SUPPORTED
319  if (++argn >= argc) /* advance to next argument */
320  usage();
321  scansarg = argv[argn];
322  /* We must postpone reading the file in case -progressive appears. */
323 #else
324  fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n",
325  progname);
327 #endif
328 
329  } else if (keymatch(arg, "transpose", 1)) {
330  /* Transpose (across UL-to-LR axis). */
332 
333  } else if (keymatch(arg, "transverse", 6)) {
334  /* Transverse transpose (across UR-to-LL axis). */
336 
337  } else if (keymatch(arg, "trim", 3)) {
338  /* Trim off any partial edge MCUs that the transform can't handle. */
340 
341  } else if (keymatch(arg, "wipe", 1)) {
342 #if TRANSFORMS_SUPPORTED
343  if (++argn >= argc) /* advance to next argument */
344  usage();
345  if (transformoption.crop /* reject multiple crop/wipe requests */ ||
346  ! jtransform_parse_crop_spec(&transformoption, argv[argn])) {
347  fprintf(stderr, "%s: bogus -wipe argument '%s'\n",
348  progname, argv[argn]);
350  }
352 #else
353  select_transform(JXFORM_NONE); /* force an error */
354 #endif
355 
356  } else {
357  usage(); /* bogus switch */
358  }
359  }
360 
361  /* Post-switch-scanning cleanup */
362 
363  if (for_real) {
364 
365 #ifdef C_PROGRESSIVE_SUPPORTED
366  if (simple_progressive) /* process -progressive; -scans can override */
367  jpeg_simple_progression(cinfo);
368 #endif
369 
370 #ifdef C_MULTISCAN_FILES_SUPPORTED
371  if (scansarg != NULL) /* process -scans if it was present */
372  if (! read_scan_script(cinfo, scansarg))
373  usage();
374 #endif
375  }
376 
377  return argn; /* return index of next arg (file name) */
378 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
static const char * progname
Definition: jpegtran.c:38
void * arg
Definition: msvc.h:12
#define argv
Definition: mplay32.c:18
select_transform(JXFORM_CODE transform)
Definition: jpegtran.c:98
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define JCOPYRIGHT
Definition: jversion.h:14
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
boolean force_grayscale
Definition: transupp.h:136
keymatch(char *arg, const char *keyword, int minchars)
Definition: cdjpeg.c:122
JXFORM_CODE transform
Definition: transupp.h:133
static char * scaleoption
Definition: jpegtran.c:40
#define EXIT_FAILURE
Definition: jerror.c:33
usage(void)
Definition: jpegtran.c:46
static char * outfilename
Definition: jpegtran.c:39
unsigned int restart_interval
Definition: jpeglib.h:370
static const WCHAR L[]
Definition: oid.c:1250
boolean arith_code
Definition: jpeglib.h:358
#define JCOPYOPT_DEFAULT
Definition: transupp.h:211
static jpeg_transform_info transformoption
Definition: jpegtran.c:42
boolean optimize_coding
Definition: jpeglib.h:359
FILE * stderr
void exit(int exitcode)
Definition: _exit.c:33
static JCOPY_OPTION copyoption
Definition: jpegtran.c:41
#define JVERSION
Definition: jversion.h:12
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by main().

◆ select_transform()

select_transform ( JXFORM_CODE  transform)

Definition at line 98 of file jpegtran.c.

102 {
103 #if TRANSFORMS_SUPPORTED
107  } else {
108  fprintf(stderr, "%s: can only do one image transformation at a time\n",
109  progname);
110  usage();
111  }
112 #else
113  fprintf(stderr, "%s: sorry, image transformation was not compiled\n",
114  progname);
116 #endif
117 }
static const char * progname
Definition: jpegtran.c:38
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
JXFORM_CODE transform
Definition: transupp.h:133
#define EXIT_FAILURE
Definition: jerror.c:33
usage(void)
Definition: jpegtran.c:46
static jpeg_transform_info transformoption
Definition: jpegtran.c:42
FILE * stderr
GLuint GLenum GLenum transform
Definition: glext.h:9407
void exit(int exitcode)
Definition: _exit.c:33

Referenced by parse_switches().

◆ usage()

usage ( void  )

Definition at line 46 of file jpegtran.c.

48 {
49  fprintf(stderr, "usage: %s [switches] ", progname);
50 #ifdef TWO_FILE_COMMANDLINE
51  fprintf(stderr, "inputfile outputfile\n");
52 #else
53  fprintf(stderr, "[inputfile]\n");
54 #endif
55 
56  fprintf(stderr, "Switches (names may be abbreviated):\n");
57  fprintf(stderr, " -copy none Copy no extra markers from source file\n");
58  fprintf(stderr, " -copy comments Copy only comment markers (default)\n");
59  fprintf(stderr, " -copy all Copy all extra markers\n");
60 #ifdef ENTROPY_OPT_SUPPORTED
61  fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n");
62 #endif
63 #ifdef C_PROGRESSIVE_SUPPORTED
64  fprintf(stderr, " -progressive Create progressive JPEG file\n");
65 #endif
66  fprintf(stderr, "Switches for modifying the image:\n");
67 #if TRANSFORMS_SUPPORTED
68  fprintf(stderr, " -crop WxH+X+Y Crop to a rectangular subarea\n");
69  fprintf(stderr, " -flip [horizontal|vertical] Mirror image (left-right or top-bottom)\n");
70  fprintf(stderr, " -grayscale Reduce to grayscale (omit color data)\n");
71  fprintf(stderr, " -perfect Fail if there is non-transformable edge blocks\n");
72  fprintf(stderr, " -rotate [90|180|270] Rotate image (degrees clockwise)\n");
73 #endif
74  fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
75 #if TRANSFORMS_SUPPORTED
76  fprintf(stderr, " -transpose Transpose image\n");
77  fprintf(stderr, " -transverse Transverse transpose image\n");
78  fprintf(stderr, " -trim Drop non-transformable edge blocks\n");
79  fprintf(stderr, " -wipe WxH+X+Y Wipe (gray out) a rectangular subarea\n");
80 #endif
81  fprintf(stderr, "Switches for advanced users:\n");
82 #ifdef C_ARITH_CODING_SUPPORTED
83  fprintf(stderr, " -arithmetic Use arithmetic coding\n");
84 #endif
85  fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
86  fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
87  fprintf(stderr, " -outfile name Specify name for output file\n");
88  fprintf(stderr, " -verbose or -debug Emit debug output\n");
89  fprintf(stderr, "Switches for wizards:\n");
90 #ifdef C_MULTISCAN_FILES_SUPPORTED
91  fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
92 #endif
94 }
static const char * progname
Definition: jpegtran.c:38
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define EXIT_FAILURE
Definition: jerror.c:33
FILE * stderr
void exit(int exitcode)
Definition: _exit.c:33

Referenced by main(), parse_switches(), and select_transform().

Variable Documentation

◆ copyoption

JCOPY_OPTION copyoption
static

Definition at line 41 of file jpegtran.c.

Referenced by main(), and parse_switches().

◆ outfilename

char* outfilename
static

Definition at line 39 of file jpegtran.c.

Referenced by main(), and parse_switches().

◆ progname

const char* progname
static

Definition at line 38 of file jpegtran.c.

Referenced by main(), parse_switches(), select_transform(), and usage().

◆ scaleoption

char* scaleoption
static

Definition at line 40 of file jpegtran.c.

Referenced by main(), and parse_switches().

◆ transformoption

jpeg_transform_info transformoption
static

Definition at line 42 of file jpegtran.c.

Referenced by main(), parse_switches(), and select_transform().